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

Function ts_lua_clear_http_ctx

plugins/lua/ts_lua_util.cc:64–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64void
65ts_lua_clear_http_ctx(ts_lua_http_ctx *http_ctx)
66{
67 if (http_ctx->rri == nullptr) {
68 if (http_ctx->client_request_url != nullptr) {
69 TSHandleMLocRelease(http_ctx->client_request_bufp, http_ctx->client_request_hdrp, http_ctx->client_request_url);
70 http_ctx->client_request_url = nullptr;
71 }
72
73 if (http_ctx->client_request_bufp != nullptr) {
74 TSHandleMLocRelease(http_ctx->client_request_bufp, TS_NULL_MLOC, http_ctx->client_request_hdrp);
75 http_ctx->client_request_bufp = nullptr;
76 http_ctx->client_request_hdrp = nullptr;
77 }
78 }
79
80 if (http_ctx->server_request_url != nullptr) {
81 TSHandleMLocRelease(http_ctx->server_request_bufp, http_ctx->server_request_hdrp, http_ctx->server_request_url);
82 http_ctx->server_request_url = nullptr;
83 }
84
85 if (http_ctx->server_request_hdrp != nullptr) {
86 TSHandleMLocRelease(http_ctx->server_request_bufp, TS_NULL_MLOC, http_ctx->server_request_hdrp);
87 http_ctx->server_request_bufp = nullptr;
88 http_ctx->server_request_hdrp = nullptr;
89 }
90
91 if (http_ctx->server_response_bufp != nullptr) {
92 TSHandleMLocRelease(http_ctx->server_response_bufp, TS_NULL_MLOC, http_ctx->server_response_hdrp);
93 http_ctx->server_response_bufp = nullptr;
94 http_ctx->server_response_hdrp = nullptr;
95 }
96
97 if (http_ctx->client_response_hdrp != nullptr) {
98 TSHandleMLocRelease(http_ctx->client_response_bufp, TS_NULL_MLOC, http_ctx->client_response_hdrp);
99 http_ctx->client_response_bufp = nullptr;
100 http_ctx->client_response_hdrp = nullptr;
101 }
102
103 if (http_ctx->cached_response_bufp != nullptr) {
104 TSMimeHdrDestroy(http_ctx->cached_response_bufp, http_ctx->cached_response_hdrp);
105 TSHandleMLocRelease(http_ctx->cached_response_bufp, TS_NULL_MLOC, http_ctx->cached_response_hdrp);
106 TSMBufferDestroy(http_ctx->cached_response_bufp);
107 http_ctx->cached_response_bufp = nullptr;
108 http_ctx->cached_response_hdrp = nullptr;
109 }
110}
111
112int
113ts_lua_create_vm(ts_lua_main_ctx *arr, int n)

Callers 2

ts_lua_http_cont_handlerFunction · 0.85
globalHookHandlerFunction · 0.85

Calls 3

TSHandleMLocReleaseFunction · 0.85
TSMimeHdrDestroyFunction · 0.85
TSMBufferDestroyFunction · 0.85

Tested by

no test coverage detected