comparison src/http/ngx_http_request.h @ 7914:9cf043a5d9ca

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.)
author Maxim Dounin <mdounin@mdounin.ru>
date Sun, 29 Aug 2021 22:22:02 +0300
parents 185c86b830ef
children f8f6b9fee66a fac88e160653
comparison
equal deleted inserted replaced
7913:185c86b830ef 7914:9cf043a5d9ca
300 off_t received; 300 off_t received;
301 ngx_chain_t *free; 301 ngx_chain_t *free;
302 ngx_chain_t *busy; 302 ngx_chain_t *busy;
303 ngx_http_chunked_t *chunked; 303 ngx_http_chunked_t *chunked;
304 ngx_http_client_body_handler_pt post_handler; 304 ngx_http_client_body_handler_pt post_handler;
305 unsigned filter_need_buffering:1;
306 unsigned last_sent:1;
305 unsigned last_saved:1; 307 unsigned last_saved:1;
306 } ngx_http_request_body_t; 308 } ngx_http_request_body_t;
307 309
308 310
309 typedef struct ngx_http_addr_conf_s ngx_http_addr_conf_t; 311 typedef struct ngx_http_addr_conf_s ngx_http_addr_conf_t;