diff options
| author | Igor Sysoev <igor@sysoev.ru> | 2011-08-29 12:56:09 +0000 |
|---|---|---|
| committer | Igor Sysoev <igor@sysoev.ru> | 2011-08-29 12:56:09 +0000 |
| commit | 8f8839f98db7c44f821e68f28614094e30fb8b22 (patch) | |
| tree | 0010548b3a9e43a9bfbdcee717660fd5cdfd2679 /src/http/ngx_http_upstream.c | |
| parent | 1c95e6c3050bf2114d72029824fdadf001cc300e (diff) | |
| download | nginx-8f8839f98db7c44f821e68f28614094e30fb8b22.tar.gz nginx-8f8839f98db7c44f821e68f28614094e30fb8b22.tar.bz2 | |
Merge of r3964, r3977, r3978:
Proxy related fixes:
*) finalizing with rc == 0 in unbuffered proxy mode caused nginx to wait
for another send_timeout before actually closing client's connection
if client timed out while still talking to upstream server
*) update r3945 with more descriptive error message
*) test length of proxy_pass with variables;
patch by Lanshun Zhou
Diffstat (limited to 'src/http/ngx_http_upstream.c')
| -rw-r--r-- | src/http/ngx_http_upstream.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c index ad5b449ec..29432dc14 100644 --- a/src/http/ngx_http_upstream.c +++ b/src/http/ngx_http_upstream.c @@ -661,10 +661,12 @@ ngx_http_upstream_cache(ngx_http_request_t *r, ngx_http_upstream_t *u) ngx_http_file_cache_create_key(r); - if (r->cache->header_start >= u->conf->buffer_size) { + if (r->cache->header_start + 256 >= u->conf->buffer_size) { ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "cache key too large, increase upstream buffer size %uz", - u->conf->buffer_size); + "%V_buffer_size %uz is not enough for cache key, " + "it should increased at least to %uz", + &u->conf->module, u->conf->buffer_size, + ngx_align(r->cache->header_start + 256, 1024)); r->cache = NULL; return NGX_DECLINED; @@ -2317,7 +2319,7 @@ ngx_http_upstream_process_non_buffered_downstream(ngx_http_request_t *r) if (wev->timedout) { c->timedout = 1; ngx_connection_error(c, NGX_ETIMEDOUT, "client timed out"); - ngx_http_upstream_finalize_request(r, u, 0); + ngx_http_upstream_finalize_request(r, u, NGX_HTTP_REQUEST_TIME_OUT); return; } @@ -3013,6 +3015,7 @@ ngx_http_upstream_finalize_request(ngx_http_request_t *r, #endif if (u->header_sent + && rc != NGX_HTTP_REQUEST_TIME_OUT && (rc == NGX_ERROR || rc >= NGX_HTTP_SPECIAL_RESPONSE)) { rc = 0; |
