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

Function ts_lua_destroy_http_ctx

plugins/lua/ts_lua_util.cc:839–888  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

837}
838
839void
840ts_lua_destroy_http_ctx(ts_lua_http_ctx *http_ctx)
841{
842 ts_lua_cont_info *ci;
843
844 ci = &http_ctx->cinfo;
845
846 if (http_ctx->rri == nullptr) {
847 if (http_ctx->client_request_url) {
848 TSHandleMLocRelease(http_ctx->client_request_bufp, http_ctx->client_request_hdrp, http_ctx->client_request_url);
849 }
850
851 if (http_ctx->client_request_bufp) {
852 TSHandleMLocRelease(http_ctx->client_request_bufp, TS_NULL_MLOC, http_ctx->client_request_hdrp);
853 }
854 }
855
856 if (http_ctx->server_request_url) {
857 TSHandleMLocRelease(http_ctx->server_request_bufp, http_ctx->server_request_hdrp, http_ctx->server_request_url);
858 }
859
860 if (http_ctx->server_request_bufp) {
861 TSHandleMLocRelease(http_ctx->server_request_bufp, TS_NULL_MLOC, http_ctx->server_request_hdrp);
862 }
863
864 if (http_ctx->server_response_bufp) {
865 TSHandleMLocRelease(http_ctx->server_response_bufp, TS_NULL_MLOC, http_ctx->server_response_hdrp);
866 }
867
868 if (http_ctx->client_response_bufp) {
869 TSHandleMLocRelease(http_ctx->client_response_bufp, TS_NULL_MLOC, http_ctx->client_response_hdrp);
870 }
871
872 if (http_ctx->cached_response_bufp) {
873 TSMimeHdrDestroy(http_ctx->cached_response_bufp, http_ctx->cached_response_hdrp);
874 TSHandleMLocRelease(http_ctx->cached_response_bufp, TS_NULL_MLOC, http_ctx->cached_response_hdrp);
875 TSMBufferDestroy(http_ctx->cached_response_bufp);
876 }
877
878 // update thread stats
879 ts_lua_main_ctx *const main_ctx = ci->routine.mctx;
880 ts_lua_ctx_stats *const stats = main_ctx->stats;
881
882 TSMutexLock(stats->mutexp);
883 --stats->threads;
884 TSMutexUnlock(stats->mutexp);
885
886 ts_lua_release_cont_info(ci);
887 TSfree(http_ctx);
888}
889
890void
891ts_lua_set_http_intercept_ctx(lua_State *L, ts_lua_http_intercept_ctx *ictx)

Callers 4

ts_lua_http_cont_handlerFunction · 0.85
ts_lua_remap_plugin_initFunction · 0.85
globalHookHandlerFunction · 0.85
TSPluginInitFunction · 0.85

Calls 7

TSHandleMLocReleaseFunction · 0.85
TSMimeHdrDestroyFunction · 0.85
TSMBufferDestroyFunction · 0.85
TSMutexLockFunction · 0.85
TSMutexUnlockFunction · 0.85
ts_lua_release_cont_infoFunction · 0.85
TSfreeFunction · 0.85

Tested by

no test coverage detected