diff options
| author | Maxim Dounin <mdounin@mdounin.ru> | 2014-11-28 16:58:39 +0300 |
|---|---|---|
| committer | Maxim Dounin <mdounin@mdounin.ru> | 2014-11-28 16:58:39 +0300 |
| commit | ece388033aef4325691a676b08a2e5278de39e71 (patch) | |
| tree | 5e9bbd8077d5570f984543570f287c782d9fb22c | |
| parent | 7fa89c744afd1f05f4405d9a60b8c63a65ea56cc (diff) | |
| download | nginx-ece388033aef4325691a676b08a2e5278de39e71.tar.gz nginx-ece388033aef4325691a676b08a2e5278de39e71.tar.bz2 | |
Write filter: fixed handling of sync bufs (ticket #132).
| -rw-r--r-- | src/http/ngx_http_write_filter_module.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/http/ngx_http_write_filter_module.c b/src/http/ngx_http_write_filter_module.c index b19f75bda..a2db53024 100644 --- a/src/http/ngx_http_write_filter_module.c +++ b/src/http/ngx_http_write_filter_module.c @@ -48,7 +48,7 @@ ngx_int_t ngx_http_write_filter(ngx_http_request_t *r, ngx_chain_t *in) { off_t size, sent, nsent, limit; - ngx_uint_t last, flush; + ngx_uint_t last, flush, sync; ngx_msec_t delay; ngx_chain_t *cl, *ln, **ll, *chain; ngx_connection_t *c; @@ -62,6 +62,7 @@ ngx_http_write_filter(ngx_http_request_t *r, ngx_chain_t *in) size = 0; flush = 0; + sync = 0; last = 0; ll = &r->out; @@ -105,6 +106,10 @@ ngx_http_write_filter(ngx_http_request_t *r, ngx_chain_t *in) flush = 1; } + if (cl->buf->sync) { + sync = 1; + } + if (cl->buf->last_buf) { last = 1; } @@ -157,6 +162,10 @@ ngx_http_write_filter(ngx_http_request_t *r, ngx_chain_t *in) flush = 1; } + if (cl->buf->sync) { + sync = 1; + } + if (cl->buf->last_buf) { last = 1; } @@ -188,7 +197,7 @@ ngx_http_write_filter(ngx_http_request_t *r, ngx_chain_t *in) && !(c->buffered & NGX_LOWLEVEL_BUFFERED) && !(last && c->need_last_buf)) { - if (last || flush) { + if (last || flush || sync) { for (cl = r->out; cl; /* void */) { ln = cl; cl = cl->next; |
