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

Function is_get_request

tests/tools/plugins/test_log_interface.cc:32–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30static TSTextLogObject pluginlog;
31
32bool
33is_get_request(TSHttpTxn transaction)
34{
35 TSMLoc req_loc;
36 TSMBuffer req_bufp;
37 if (TSHttpTxnClientReqGet(transaction, &req_bufp, &req_loc) == TS_ERROR) {
38 TSError("Error while retrieving client request header\n");
39 return false;
40 }
41 int method_len = 0;
42 const char *method = TSHttpHdrMethodGet(req_bufp, req_loc, &method_len);
43 if (method_len != static_cast<int>(strlen(TS_HTTP_METHOD_GET)) || strncasecmp(method, TS_HTTP_METHOD_GET, method_len) != 0) {
44 TSHandleMLocRelease(req_bufp, TS_NULL_MLOC, req_loc);
45 return false;
46 }
47 TSHandleMLocRelease(req_bufp, TS_NULL_MLOC, req_loc);
48 return true;
49}
50
51int
52global_handler(TSCont /* continuation ATS_UNUSED */, TSEvent event, void *data)

Callers 1

global_handlerFunction · 0.85

Calls 4

TSHttpTxnClientReqGetFunction · 0.85
TSHttpHdrMethodGetFunction · 0.85
TSHandleMLocReleaseFunction · 0.85
TSErrorFunction · 0.50

Tested by

no test coverage detected