Skip to content

Commit 3c296f8

Browse files
author
Matteo Brancaleoni
committed
Fix parsing when using large header buffers
If headers are large, nginx may switch to a large header buffer (8K for example). If the POST request fits into this buffer, it will be contained into the preread size and ngx_http_request_body_filter will read everything leaving nothing more to do. So we just cleanup and go on.
1 parent a4da9a9 commit 3c296f8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

ngx_http_upload_module.c

+10
Original file line numberDiff line numberDiff line change
@@ -873,6 +873,16 @@ ngx_http_read_upload_client_request_body(ngx_http_request_t *r)
873873

874874
rc = ngx_http_do_read_client_request_body(r);
875875
goto done;
876+
} else if (rb->rest == 0) {
877+
/* everything already read in ngx_http_request_body_filter */
878+
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "http client request body fully read in ngx_http_request_body_filter");
879+
880+
if (r->connection->read->timer_set) {
881+
ngx_del_timer(r->connection->read);
882+
}
883+
upload_shutdown_ctx(u);
884+
885+
return ngx_http_upload_body_handler(r);
876886
}
877887

878888
} else {

0 commit comments

Comments
 (0)