MCPcopy Create free account
hub / github.com/apache/trafficserver / should_push

Function should_push

example/plugins/c-api/server_push/server_push.cc:45–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43char url[256];
44
45bool
46should_push(TSHttpTxn txnp)
47{
48 TSMBuffer mbuf;
49 TSMLoc hdr, in_url;
50 if (TSHttpTxnClientReqGet(txnp, &mbuf, &hdr) != TS_SUCCESS) {
51 return false;
52 }
53 if (TSHttpHdrUrlGet(mbuf, hdr, &in_url) != TS_SUCCESS) {
54 return false;
55 }
56 int len;
57 TSUrlHttpQueryGet(mbuf, in_url, &len);
58 TSHandleMLocRelease(mbuf, hdr, in_url);
59 TSHandleMLocRelease(mbuf, TS_NULL_MLOC, hdr);
60 if (len > 0) {
61 return true;
62 } else {
63 return false;
64 }
65}
66
67static int
68server_push_plugin(TSCont contp, TSEvent event, void *edata)

Callers 1

server_push_pluginFunction · 0.85

Calls 4

TSHttpTxnClientReqGetFunction · 0.85
TSHttpHdrUrlGetFunction · 0.85
TSUrlHttpQueryGetFunction · 0.85
TSHandleMLocReleaseFunction · 0.85

Tested by

no test coverage detected