| 62 | } |
| 63 | |
| 64 | void |
| 65 | ts_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 | |
| 112 | int |
| 113 | ts_lua_create_vm(ts_lua_main_ctx *arr, int n) |
no test coverage detected