aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_request.h
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2021-08-29 22:22:02 +0300
committerMaxim Dounin <mdounin@mdounin.ru>2021-08-29 22:22:02 +0300
commit67d160bf25e02ba6679bb6c3b9cbdfeb29b759de (patch)
treeff76312fe9cba7e3c339e71a053c1888d1bdab45 /src/http/ngx_http_request.h
parent2a709213800fd3fd2809881374eb110562b53c08 (diff)
downloadnginx-67d160bf25e02ba6679bb6c3b9cbdfeb29b759de.tar.gz
nginx-67d160bf25e02ba6679bb6c3b9cbdfeb29b759de.zip
Request body: reading body buffering in filters.
If a filter wants to buffer the request body during reading (for example, to check an external scanner), it can now do so. To make it possible, the code now checks rb->last_saved (introduced in the previous change) along with rb->rest == 0. Since in HTTP/2 this requires flow control to avoid overflowing the request body buffer, so filters which need buffering have to set the rb->filter_need_buffering flag on the first filter call. (Note that each filter is expected to call the next filter, so all filters will be able set the flag if needed.)
Diffstat (limited to 'src/http/ngx_http_request.h')
-rw-r--r--src/http/ngx_http_request.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/http/ngx_http_request.h b/src/http/ngx_http_request.h
index 896657890..b1269d22d 100644
--- a/src/http/ngx_http_request.h
+++ b/src/http/ngx_http_request.h
@@ -302,6 +302,8 @@ typedef struct {
ngx_chain_t *busy;
ngx_http_chunked_t *chunked;
ngx_http_client_body_handler_pt post_handler;
+ unsigned filter_need_buffering:1;
+ unsigned last_sent:1;
unsigned last_saved:1;
} ngx_http_request_body_t;