Skip to content

Commit 0566d65

Browse files
committed
Fixed hang up when post multiple request
1 parent 22b8293 commit 0566d65

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

nginx/modsecurity/ngx_http_modsecurity.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ modsecurity_write_body_cb(request_rec *rec, char *buf, unsigned int length)
343343
/* set request body */
344344
b = r->header_in;
345345

346-
if (b->end - b->pos < length) {
346+
if (b->end < b->pos + length) {
347347
b->start = ngx_palloc(ctx->r->pool, length);
348348
if (b->start == NULL) {
349349
return APR_EINVAL;
@@ -641,6 +641,7 @@ ngx_http_modsecurity_request_body_handler(ngx_http_request_t *r)
641641

642642
r->phase_handler++;
643643
ngx_http_core_run_phases(r);
644+
ngx_http_finalize_request(r, NGX_DONE);
644645
}
645646

646647

0 commit comments

Comments
 (0)