Skip to content

Commit 1919c3a

Browse files
committed
Merge pull request #67 from chaizhenhua/remotes/trunk
Nginx Improved response body filter, issue #56 might be fixed
2 parents 72a3389 + 74278a8 commit 1919c3a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

nginx/modsecurity/ngx_http_modsecurity.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,15 +1162,21 @@ ngx_http_modsecurity_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
11621162
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "modSecurity: body filter");
11631163

11641164
if (in == NULL) {
1165+
/* waiting for more buffer */
1166+
r->buffered |= NGX_HTTP_SSI_BUFFERED;
11651167
return NGX_AGAIN;
11661168
}
11671169

11681170
rc = move_chain_to_brigade(in, ctx->brigade, r->pool, 0);
11691171
if (rc != NGX_OK) {
1172+
/* waiting for more buffer */
1173+
r->buffered |= NGX_HTTP_SSI_BUFFERED;
11701174
return rc;
11711175
}
11721176

11731177
/* last buf has been saved */
1178+
r->buffered &= ~NGX_HTTP_SSI_BUFFERED;
1179+
11741180
ctx->complete = 1;
11751181
modsecSetResponseBrigade(ctx->req, ctx->brigade);
11761182

0 commit comments

Comments
 (0)