diff options
author | Glenn Strauss <gstrauss@gluelogic.com> | 2023-05-01 02:16:26 -0400 |
---|---|---|
committer | Glenn Strauss <gstrauss@gluelogic.com> | 2023-05-03 23:11:35 -0400 |
commit | 0ce53275debc0a9eac67dbc2c006fa585b4b94e3 (patch) | |
tree | f85249d8a866329d8ba2a9edf43052714bd2d4c6 | |
parent | 424d7d99b3340aaa45bfb7ef58b72788141cff2c (diff) | |
download | lighttpd-git-0ce53275debc0a9eac67dbc2c006fa585b4b94e3.tar.gz |
[mod_cgi] reset upload_temp_file_size in CGI close
reset upload_temp_file_size in cgi_connection_close if p->tempfile_accum
-rw-r--r-- | src/mod_cgi.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mod_cgi.c b/src/mod_cgi.c index 7af7a40f..c23b62b3 100644 --- a/src/mod_cgi.c +++ b/src/mod_cgi.c @@ -482,6 +482,12 @@ static void cgi_connection_close(handler_ctx *hctx) { } cgi_handler_ctx_free(hctx); + /* (r->reqbody_queue.upload_temp_file_size might have been changed even + * with 0 == r->reqbody_length, if hctx->conf.upgrade is set) */ + if (p->tempfile_accum) /*(and if not streaming)*/ + chunkqueue_set_tempdirs(&r->reqbody_queue, /* reset sz */ + r->reqbody_queue.tempdirs, 0); + /* finish response (if not already r->resp_body_started, r->resp_body_finished) */ if (r->handler_module == p->self) { http_response_backend_done(r); @@ -491,8 +497,6 @@ static void cgi_connection_close(handler_ctx *hctx) { static handler_t cgi_connection_close_callback(request_st * const r, void *p_d) { handler_ctx *hctx = r->plugin_ctx[((plugin_data *)p_d)->id]; if (hctx) { - chunkqueue_set_tempdirs(&r->reqbody_queue, /* reset sz */ - r->reqbody_queue.tempdirs, 0); cgi_connection_close(hctx); } return HANDLER_GO_ON; |