Mercurial > hg > nginx-mail
diff src/http/ngx_http_postpone_filter_module.c @ 144:e1c6ac408b68 NGINX_0_3_19
nginx 0.3.19
*) Feature: the "path" and "alias" directives support the variables.
*) Change: now the "valid_referers" directive again checks the URI part.
*) Bugfix: in SSI handling.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Wed, 28 Dec 2005 00:00:00 +0300 |
parents | 91372f004adf |
children | 36af50a5582d |
line wrap: on
line diff
--- a/src/http/ngx_http_postpone_filter_module.c +++ b/src/http/ngx_http_postpone_filter_module.c @@ -102,18 +102,22 @@ ngx_http_postpone_filter(ngx_http_reques out = in; } - if (out == NULL && r->main->out == NULL && !r->main->connection->buffered) { - return NGX_OK; - } + rc = NGX_OK; + + if (out || r->main->out || r->main->connection->buffered) { + + ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, + "http postpone filter out \"%V?%V\"", &r->uri, &r->args); - ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "http postpone filter out \"%V?%V\"", &r->uri, &r->args); + if (!(out && out->next == NULL && ngx_buf_sync_only(out->buf))) { + + rc = ngx_http_next_filter(r->main, out); - rc = ngx_http_next_filter(r->main, out); - - if (rc == NGX_ERROR) { - /* NGX_ERROR may be returned by any filter */ - r->connection->error = 1; + if (rc == NGX_ERROR) { + /* NGX_ERROR may be returned by any filter */ + r->connection->error = 1; + } + } } if (r->postponed == NULL) { @@ -135,6 +139,7 @@ static ngx_int_t ngx_http_postpone_filter_output_postponed_request(ngx_http_request_t *r) { ngx_int_t rc; + ngx_chain_t *out; ngx_http_postponed_request_t *pr; for ( ;; ) { @@ -165,13 +170,17 @@ ngx_http_postpone_filter_output_postpone pr = r->postponed; } - if (pr->out) { + out = pr->out; + + if (out) { ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "http postpone filter out postponed \"%V?%V\"", &r->uri, &r->args); - if (ngx_http_next_filter(r->main, pr->out) == NGX_ERROR) { - return NGX_ERROR; + if (!(out && out->next == NULL && ngx_buf_sync_only(out->buf))) { + if (ngx_http_next_filter(r->main, out) == NGX_ERROR) { + return NGX_ERROR; + } } }