aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2009-04-15 12:25:51 +0000
committerIgor Sysoev <igor@sysoev.ru>2009-04-15 12:25:51 +0000
commit9bd1010164eb288e750e56a44b0ca121951e0916 (patch)
tree8c09dc35b1373f8cfc57017b1bcc6a1404c5bcd4 /src
parentdc7a872a4367e956cd6007d40201e51965be6574 (diff)
downloadnginx-9bd1010164eb288e750e56a44b0ca121951e0916.tar.gz
nginx-9bd1010164eb288e750e56a44b0ca121951e0916.zip
fix building --without-http-cache, introduced in r2664 and later
Diffstat (limited to 'src')
-rw-r--r--src/http/ngx_http_upstream.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
index 74de6710e..369c7bb28 100644
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -2843,8 +2843,6 @@ static ngx_int_t
ngx_http_upstream_process_cache_control(ngx_http_request_t *r,
ngx_table_elt_t *h, ngx_uint_t offset)
{
- u_char *p, *last;
- ngx_int_t n;
ngx_array_t *pa;
ngx_table_elt_t **ph;
@@ -2864,6 +2862,11 @@ ngx_http_upstream_process_cache_control(ngx_http_request_t *r,
*ph = h;
+#if (NGX_HTTP_CACHE)
+ {
+ u_char *p, *last;
+ ngx_int_t n;
+
if (r->cache == NULL) {
return NGX_OK;
}
@@ -2909,6 +2912,9 @@ ngx_http_upstream_process_cache_control(ngx_http_request_t *r,
}
r->cache->valid_sec = ngx_time() + n;
+ }
+#endif
+
return NGX_OK;
}
@@ -2917,10 +2923,12 @@ static ngx_int_t
ngx_http_upstream_process_expires(ngx_http_request_t *r, ngx_table_elt_t *h,
ngx_uint_t offset)
{
- time_t expires;
-
r->upstream->headers_in.expires = h;
+#if (NGX_HTTP_CACHE)
+ {
+ time_t expires;
+
if (r->cache == NULL) {
return NGX_OK;
}
@@ -2937,6 +2945,8 @@ ngx_http_upstream_process_expires(ngx_http_request_t *r, ngx_table_elt_t *h,
}
r->cache->valid_sec = expires;
+ }
+#endif
return NGX_OK;
}
@@ -2946,12 +2956,14 @@ static ngx_int_t
ngx_http_upstream_process_accel_expires(ngx_http_request_t *r,
ngx_table_elt_t *h, ngx_uint_t offset)
{
+ r->upstream->headers_in.x_accel_expires = h;
+
+#if (NGX_HTTP_CACHE)
+ {
u_char *p;
size_t len;
ngx_int_t n;
- r->upstream->headers_in.x_accel_expires = h;
-
if (r->cache == NULL) {
return NGX_OK;
}
@@ -2982,6 +2994,8 @@ ngx_http_upstream_process_accel_expires(ngx_http_request_t *r,
if (n != NGX_ERROR) {
r->cache->valid_sec = n;
}
+ }
+#endif
return NGX_OK;
}