diff options
author | Igor Sysoev <igor@sysoev.ru> | 2003-11-25 23:44:56 +0300 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2003-11-25 23:44:56 +0300 |
commit | a8fa0a6a37b6e90324e0dcbf4733324199623841 (patch) | |
tree | 1a7edec9aa04946afc22299bf587823488fb492f /src/http/modules/proxy/ngx_http_proxy_cache.c | |
parent | d9d0ca12688034d481e2f1f5cf13a098338ec31d (diff) |
nginx-0.0.1-2003-11-25-23:44:56 import
Diffstat (limited to 'src/http/modules/proxy/ngx_http_proxy_cache.c')
-rw-r--r-- | src/http/modules/proxy/ngx_http_proxy_cache.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/http/modules/proxy/ngx_http_proxy_cache.c b/src/http/modules/proxy/ngx_http_proxy_cache.c index 05fec3a19..9661cff96 100644 --- a/src/http/modules/proxy/ngx_http_proxy_cache.c +++ b/src/http/modules/proxy/ngx_http_proxy_cache.c @@ -86,6 +86,7 @@ static int ngx_http_proxy_process_cached_response(ngx_http_proxy_ctx_t *p, } if (rc == NGX_HTTP_CACHE_STALE || rc == NGX_HTTP_CACHE_AGED) { + p->state->expired = ngx_time() - p->cache->ctx.expires; p->header_in->pos = p->header_in->start + p->cache->ctx.header_size; if (ngx_http_proxy_process_cached_header(p) == NGX_ERROR) { @@ -487,6 +488,8 @@ int ngx_http_proxy_send_cached_response(ngx_http_proxy_ctx_t *p) out[i].hunk->type |= NGX_HUNK_LAST; } + r->file.fd = p->cache->ctx.file.fd; + return ngx_http_output_filter(r, out); } @@ -600,7 +603,7 @@ int ngx_http_proxy_update_cache(ngx_http_proxy_ctx_t *p) ep = p->upstream->event_pipe; -ngx_log_debug(p->request->connection->log, "LEN: " OFF_FMT ", " OFF_FMT _ +ngx_log_debug(p->request->connection->log, "LEN: " OFF_T_FMT ", " OFF_T_FMT _ p->cache->ctx.length _ ep->read_length); if (p->cache->ctx.length == -1) { |