mirror of
https://github.com/nginx/nginx.git
synced 2025-02-25 18:55:26 -06:00
Added r->response_sent flag.
The flag indicates that the entire response was sent to the socket up to the last_buf flag. The flag is only usable for protocol implementations that call ngx_http_write_filter() from header filter, such as HTTP/1.x and HTTP/3.
This commit is contained in:
parent
3c31d3f421
commit
b6b2a45fb6
@ -547,6 +547,7 @@ struct ngx_http_request_s {
|
||||
unsigned request_complete:1;
|
||||
unsigned request_output:1;
|
||||
unsigned header_sent:1;
|
||||
unsigned response_sent:1;
|
||||
unsigned expect_tested:1;
|
||||
unsigned root_tested:1;
|
||||
unsigned done:1;
|
||||
|
@ -239,6 +239,10 @@ ngx_http_write_filter(ngx_http_request_t *r, ngx_chain_t *in)
|
||||
r->out = NULL;
|
||||
c->buffered &= ~NGX_HTTP_WRITE_BUFFERED;
|
||||
|
||||
if (last) {
|
||||
r->response_sent = 1;
|
||||
}
|
||||
|
||||
return NGX_OK;
|
||||
}
|
||||
|
||||
@ -350,6 +354,10 @@ ngx_http_write_filter(ngx_http_request_t *r, ngx_chain_t *in)
|
||||
|
||||
c->buffered &= ~NGX_HTTP_WRITE_BUFFERED;
|
||||
|
||||
if (last) {
|
||||
r->response_sent = 1;
|
||||
}
|
||||
|
||||
if ((c->buffered & NGX_LOWLEVEL_BUFFERED) && r->postponed == NULL) {
|
||||
return NGX_AGAIN;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user