summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2008-11-05 16:27:45 +0000
committerIgor Sysoev <igor@sysoev.ru>2008-11-05 16:27:45 +0000
commite4c10b25d474f939e0d5384eb0558804bdd7c490 (patch)
tree182888b9eadf9f8ad5271267ebcb6f6007a46732
parent4f79acbdd8160bc1cadc4334281ccb235618deba (diff)
downloadnginx-e4c10b25d474f939e0d5384eb0558804bdd7c490.tar.gz
nginx-e4c10b25d474f939e0d5384eb0558804bdd7c490.tar.bz2
do not pass gzheader separately as due to the previous commit
we do not use ctx->busy as flush condition
-rw-r--r--src/http/modules/ngx_http_gzip_filter_module.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/http/modules/ngx_http_gzip_filter_module.c b/src/http/modules/ngx_http_gzip_filter_module.c
index 7e21239cc..54e2cffcc 100644
--- a/src/http/modules/ngx_http_gzip_filter_module.c
+++ b/src/http/modules/ngx_http_gzip_filter_module.c
@@ -265,7 +265,7 @@ ngx_http_gzip_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
int rc, wbits, memlevel;
struct gztrailer *trailer;
ngx_buf_t *b;
- ngx_chain_t *cl, out;
+ ngx_chain_t *cl;
ngx_http_gzip_ctx_t *ctx;
ngx_http_gzip_conf_t *conf;
@@ -336,24 +336,18 @@ ngx_http_gzip_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
b->pos = gzheader;
b->last = b->pos + 10;
- out.buf = b;
- out.next = NULL;
-
- /*
- * We pass the gzheader to the next filter now to avoid its linking
- * to the ctx->busy chain. zlib does not usually output the compressed
- * data in the initial iterations, so the gzheader that was linked
- * to the ctx->busy chain would be flushed by ngx_http_write_filter().
- */
-
- if (ngx_http_next_body_filter(r, &out) == NGX_ERROR) {
+ cl = ngx_alloc_chain_link(r->pool);
+ if (cl == NULL) {
ngx_http_gzip_error(ctx);
return NGX_ERROR;
}
- r->connection->buffered |= NGX_HTTP_GZIP_BUFFERED;
+ cl->buf = b;
+ cl->next = NULL;
+ ctx->out = cl;
+ ctx->last_out = &cl->next;
- ctx->last_out = &ctx->out;
+ r->connection->buffered |= NGX_HTTP_GZIP_BUFFERED;
ctx->crc32 = crc32(0L, Z_NULL, 0);
ctx->flush = Z_NO_FLUSH;