diff options
| author | Igor Sysoev <igor@sysoev.ru> | 2010-02-01 15:46:14 +0000 |
|---|---|---|
| committer | Igor Sysoev <igor@sysoev.ru> | 2010-02-01 15:46:14 +0000 |
| commit | 95a5ecb1ac78b14b759ada666b2114783fc1c2d2 (patch) | |
| tree | 69fc825a431c976c901abe733501a8662e048845 /src/http/ngx_http_file_cache.c | |
| parent | 848cc35a653e893add69b580c864d0cd8b419860 (diff) | |
| download | nginx-95a5ecb1ac78b14b759ada666b2114783fc1c2d2.tar.gz nginx-95a5ecb1ac78b14b759ada666b2114783fc1c2d2.tar.bz2 | |
merge r3137, r3198, r3199, r3353, r3370, r3371, r3398, r3399:
cache related fixes:
*) do not pass buf with empty cached response,
this fixes "zero size buf in output" alert
*) hide cacheable Set-Cookie and P3P FastCGI response headers
*) test comma separator in "Cache-Control"
*) a cache manager thread handle was overwritten by a cache loader thread
handle, this caused an exit delay, the bug had been introduced in r3248
*) fix handling cached HTTP/0.9 response
*) log proxied HTTP/0.9 responses status as "009"
*) fix the "If-None-Match" header name
*) fix a cached zero-length body case
Diffstat (limited to 'src/http/ngx_http_file_cache.c')
| -rw-r--r-- | src/http/ngx_http_file_cache.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/http/ngx_http_file_cache.c b/src/http/ngx_http_file_cache.c index a60483d59..c02bc7740 100644 --- a/src/http/ngx_http_file_cache.c +++ b/src/http/ngx_http_file_cache.c @@ -311,7 +311,7 @@ ngx_http_file_cache_open(ngx_http_request_t *r) return n; } - if ((size_t) n <= c->header_start) { + if ((size_t) n < c->header_start) { ngx_log_error(NGX_LOG_CRIT, r->connection->log, 0, "cache file \"%s\" is too small", c->file.name.data); return NGX_ERROR; @@ -718,6 +718,8 @@ ngx_http_cache_send(ngx_http_request_t *r) return NGX_HTTP_INTERNAL_SERVER_ERROR; } + r->header_only = (c->length - c->body_start) == 0; + rc = ngx_http_send_header(r); if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) { @@ -727,7 +729,7 @@ ngx_http_cache_send(ngx_http_request_t *r) b->file_pos = c->body_start; b->file_last = c->length; - b->in_file = (c->length - c->body_start) ? 1: 0; + b->in_file = 1; b->last_buf = (r == r->main) ? 1: 0; b->last_in_chain = 1; |
