Mercurial > hg > nginx-quic
comparison src/http/ngx_http_upstream.c @ 3195:b495a56f1f24
use real file cache length, this fixes cache size counting for responses
without "Content-Length" header and 304 responses.
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 07 Oct 2009 12:55:58 +0000 |
parents | b1013d768911 |
children | 48bfb7dc981b |
comparison
equal
deleted
inserted
replaced
3194:9966af1d5819 | 3195:b495a56f1f24 |
---|---|
2096 if (valid) { | 2096 if (valid) { |
2097 r->cache->last_modified = r->headers_out.last_modified_time; | 2097 r->cache->last_modified = r->headers_out.last_modified_time; |
2098 r->cache->date = now; | 2098 r->cache->date = now; |
2099 r->cache->body_start = (u_short) (u->buffer.pos - u->buffer.start); | 2099 r->cache->body_start = (u_short) (u->buffer.pos - u->buffer.start); |
2100 | 2100 |
2101 if (r->headers_out.content_length_n != -1) { | |
2102 r->cache->length = r->cache->body_start | |
2103 + r->headers_out.content_length_n; | |
2104 } | |
2105 | |
2106 ngx_http_file_cache_set_header(r, u->buffer.start); | 2101 ngx_http_file_cache_set_header(r, u->buffer.start); |
2107 | 2102 |
2108 } else { | 2103 } else { |
2109 u->cacheable = 0; | 2104 u->cacheable = 0; |
2110 r->headers_out.last_modified_time = -1; | 2105 r->headers_out.last_modified_time = -1; |