Welcome! Log In Create A New Profile

Advanced

[nginx] Gzip: clearing of c->buffered if all data are flushed.

Maxim Dounin
July 25, 2013 08:00AM
details: http://hg.nginx.org/nginx/rev/84155a389bcc
branches:
changeset: 5291:84155a389bcc
user: Maxim Dounin <mdounin@mdounin.ru>
date: Thu Jul 25 14:55:32 2013 +0400
description:
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:

src/http/modules/ngx_http_gzip_filter_module.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)

diffs (30 lines):

diff --git a/src/http/modules/ngx_http_gzip_filter_module.c b/src/http/modules/ngx_http_gzip_filter_module.c
--- 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_reque
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_h
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_re
*ctx->last_out = cl;
ctx->last_out = &cl->next;

+ r->connection->buffered &= ~NGX_HTTP_GZIP_BUFFERED;
+
return NGX_OK;
}


_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Gzip: clearing of c->buffered if all data are flushed.

Maxim Dounin 624 July 25, 2013 08:00AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 250
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready