diff options
author | Igor Sysoev <igor@sysoev.ru> | 2006-10-30 20:25:22 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2006-10-30 20:25:22 +0000 |
commit | 020ffea637440e4283e1be11a96ded2674fdf8a0 (patch) | |
tree | 104bb79a9ab4beb5631863002894cfa019b2b27f | |
parent | d0427afb8bf06149f2dadad118e5f30cbd7f3cff (diff) | |
download | nginx-020ffea637440e4283e1be11a96ded2674fdf8a0.tar.gz nginx-020ffea637440e4283e1be11a96ded2674fdf8a0.zip |
high level HTTP buffered flags should be on per-subrequest basis,
this fix a bug in SSI when a big static file is included
-rw-r--r-- | src/core/ngx_connection.h | 6 | ||||
-rw-r--r-- | src/http/modules/ngx_http_ssi_filter_module.c | 7 | ||||
-rw-r--r-- | src/http/ngx_http_copy_filter_module.c | 12 | ||||
-rw-r--r-- | src/http/ngx_http_request.c | 2 | ||||
-rw-r--r-- | src/http/ngx_http_request.h | 12 |
5 files changed, 28 insertions, 11 deletions
diff --git a/src/core/ngx_connection.h b/src/core/ngx_connection.h index 2c694fa27..1694dd451 100644 --- a/src/core/ngx_connection.h +++ b/src/core/ngx_connection.h @@ -92,8 +92,8 @@ typedef enum { } ngx_connection_tcp_nopush_e; -#define NGX_LOWLEVEL_BUFFERED 0x0000000f -#define NGX_SSL_BUFFERED 0x00000001 +#define NGX_LOWLEVEL_BUFFERED 0x0f +#define NGX_SSL_BUFFERED 0x01 struct ngx_connection_s { @@ -133,7 +133,7 @@ struct ngx_connection_s { ngx_atomic_uint_t number; - ngx_uint_t buffered; + unsigned buffered:8; unsigned log_error:2; /* ngx_connection_log_error_e */ diff --git a/src/http/modules/ngx_http_ssi_filter_module.c b/src/http/modules/ngx_http_ssi_filter_module.c index dc0249867..1ee34db00 100644 --- a/src/http/modules/ngx_http_ssi_filter_module.c +++ b/src/http/modules/ngx_http_ssi_filter_module.c @@ -973,6 +973,13 @@ ngx_http_ssi_output(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx) } } + if (ctx->in || ctx->buf) { + r->buffered |= NGX_HTTP_SSI_BUFFERED; + + } else { + r->buffered &= ~NGX_HTTP_SSI_BUFFERED; + } + return rc; } diff --git a/src/http/ngx_http_copy_filter_module.c b/src/http/ngx_http_copy_filter_module.c index 311c195b9..c96dbfa76 100644 --- a/src/http/ngx_http_copy_filter_module.c +++ b/src/http/ngx_http_copy_filter_module.c @@ -109,13 +109,21 @@ ngx_http_copy_filter(ngx_http_request_t *r, ngx_chain_t *in) rc = ngx_output_chain(ctx, in); -#if (NGX_DEBUG) if (!c->destroyed) { + + if (ctx->in == NULL) { + r->buffered &= ~NGX_HTTP_COPY_BUFFERED; + } else { + r->buffered |= NGX_HTTP_COPY_BUFFERED; + } + +#if (NGX_DEBUG) ngx_log_debug3(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "copy filter: %i \"%V?%V\"", rc, &r->uri, &r->args); - } #endif + } + return rc; } diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c index a7bbcddd5..951db75e4 100644 --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -1736,7 +1736,7 @@ ngx_http_writer(ngx_http_request_t *r) ngx_http_close_request(r, 0); } - if (r == r->main) { + if (r == r->main || r->buffered) { return; } diff --git a/src/http/ngx_http_request.h b/src/http/ngx_http_request.h index 1e98b2df0..57ffe4c77 100644 --- a/src/http/ngx_http_request.h +++ b/src/http/ngx_http_request.h @@ -111,11 +111,11 @@ #define NGX_HTTP_INSUFFICIENT_STORAGE 507 -#define NGX_HTTP_LOWLEVEL_BUFFERED 0x000000f0 -#define NGX_HTTP_WRITE_BUFFERED 0x00000010 -#define NGX_HTTP_GZIP_BUFFERED 0x00000020 -#define NGX_HTTP_SSI_BUFFERED 0x00000100 -#define NGX_HTTP_COPY_BUFFERED 0x00000200 +#define NGX_HTTP_LOWLEVEL_BUFFERED 0xf0 +#define NGX_HTTP_WRITE_BUFFERED 0x10 +#define NGX_HTTP_GZIP_BUFFERED 0x20 +#define NGX_HTTP_SSI_BUFFERED 0x01 +#define NGX_HTTP_COPY_BUFFERED 0x02 typedef enum { @@ -452,6 +452,8 @@ struct ngx_http_request_s { unsigned done:1; unsigned utf8:1; + unsigned buffered:4; + unsigned main_filter_need_in_memory:1; unsigned filter_need_in_memory:1; unsigned filter_need_temporary:1; |