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

Function XDeleteDebugHdr

plugins/xdebug/xdebug.cc:788–817  ·  view source on GitHub ↗

Continuation function to delete the x-debug header.

Source from the content-addressed store, hash-verified

786// Continuation function to delete the x-debug header.
787//
788static int
789XDeleteDebugHdr(TSCont /* contp */, TSEvent event, void *edata)
790{
791 TSHttpTxn txn = static_cast<TSHttpTxn>(edata);
792 TSMLoc hdr, field;
793 TSMBuffer buffer;
794
795 // Make sure TSHttpTxnReenable(txn, TS_EVENT_HTTP_CONTINUE) is called before exiting function.
796 //
797 ts::PostScript ps([=]() -> void { TSHttpTxnReenable(txn, TS_EVENT_HTTP_CONTINUE); });
798
799 TSReleaseAssert(event == TS_EVENT_HTTP_CACHE_LOOKUP_COMPLETE);
800
801 if (TSHttpTxnClientReqGet(txn, &buffer, &hdr) == TS_ERROR) {
802 return TS_EVENT_NONE;
803 }
804
805 field = TSMimeHdrFieldFind(buffer, hdr, xDebugHeader.str, xDebugHeader.len);
806 if (field == TS_NULL_MLOC) {
807 return TS_EVENT_NONE;
808 }
809
810 if (TSMimeHdrFieldDestroy(buffer, hdr, field) == TS_ERROR) {
811 TSError("Failure destroying %s header", xDebugHeader.str);
812 }
813
814 TSHandleMLocRelease(buffer, hdr, field);
815
816 return TS_EVENT_NONE;
817}
818
819static void
820updateAllowedHeaders(const char *optarg)

Callers

nothing calls this directly

Calls 6

TSHttpTxnReenableFunction · 0.85
TSHttpTxnClientReqGetFunction · 0.85
TSMimeHdrFieldFindFunction · 0.85
TSMimeHdrFieldDestroyFunction · 0.85
TSHandleMLocReleaseFunction · 0.85
TSErrorFunction · 0.50

Tested by

no test coverage detected