aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2013-07-25 14:55:32 +0400
committerMaxim Dounin <mdounin@mdounin.ru>2013-07-25 14:55:32 +0400
commit84d2ecf87ee0c1b7a5f1b415f73dbb864cdef0ed (patch)
treea3ab6353e31e043a9a368a406698e2d5ffeb23e0 /src
parentbe6fbbb47eccf451369373026f9c060227dbab31 (diff)
downloadnginx-84d2ecf87ee0c1b7a5f1b415f73dbb864cdef0ed.tar.gz
nginx-84d2ecf87ee0c1b7a5f1b415f73dbb864cdef0ed.zip
Gzip: clearing of c->buffered if all data are flushed.
This allows to finalize unfinished responses while still sending as much data as available.
Diffstat (limited to 'src')
-rw-r--r--src/http/modules/ngx_http_gzip_filter_module.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/http/modules/ngx_http_gzip_filter_module.c b/src/http/modules/ngx_http_gzip_filter_module.c
index 35dd07ec4..837b0bc98 100644
--- a/src/http/modules/ngx_http_gzip_filter_module.c
+++ b/src/http/modules/ngx_http_gzip_filter_module.c
@@ -368,6 +368,8 @@ ngx_http_gzip_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
if (ngx_chain_add_copy(r->pool, &ctx->in, in) != NGX_OK) {
goto failed;
}
+
+ r->connection->buffered |= NGX_HTTP_GZIP_BUFFERED;
}
if (ctx->nomem) {
@@ -620,8 +622,6 @@ ngx_http_gzip_filter_deflate_start(ngx_http_request_t *r,
return NGX_ERROR;
}
- r->connection->buffered |= NGX_HTTP_GZIP_BUFFERED;
-
ctx->last_out = &ctx->out;
ctx->crc32 = crc32(0L, Z_NULL, 0);
ctx->flush = Z_NO_FLUSH;
@@ -854,6 +854,8 @@ ngx_http_gzip_filter_deflate(ngx_http_request_t *r, ngx_http_gzip_ctx_t *ctx)
*ctx->last_out = cl;
ctx->last_out = &cl->next;
+ r->connection->buffered &= ~NGX_HTTP_GZIP_BUFFERED;
+
return NGX_OK;
}