Mercurial > hg > nginx
comparison src/http/ngx_http_upstream.c @ 2708:4c658be4ab63
fix building --without-http-cache, introduced in r2664 and later
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 15 Apr 2009 12:25:51 +0000 |
parents | ac1e2e199c9f |
children | 9cc973b46af1 |
comparison
equal
deleted
inserted
replaced
2707:d7368a34b6fa | 2708:4c658be4ab63 |
---|---|
2841 | 2841 |
2842 static ngx_int_t | 2842 static ngx_int_t |
2843 ngx_http_upstream_process_cache_control(ngx_http_request_t *r, | 2843 ngx_http_upstream_process_cache_control(ngx_http_request_t *r, |
2844 ngx_table_elt_t *h, ngx_uint_t offset) | 2844 ngx_table_elt_t *h, ngx_uint_t offset) |
2845 { | 2845 { |
2846 u_char *p, *last; | |
2847 ngx_int_t n; | |
2848 ngx_array_t *pa; | 2846 ngx_array_t *pa; |
2849 ngx_table_elt_t **ph; | 2847 ngx_table_elt_t **ph; |
2850 | 2848 |
2851 pa = &r->upstream->headers_in.cache_control; | 2849 pa = &r->upstream->headers_in.cache_control; |
2852 | 2850 |
2862 return NGX_ERROR; | 2860 return NGX_ERROR; |
2863 } | 2861 } |
2864 | 2862 |
2865 *ph = h; | 2863 *ph = h; |
2866 | 2864 |
2865 #if (NGX_HTTP_CACHE) | |
2866 { | |
2867 u_char *p, *last; | |
2868 ngx_int_t n; | |
2869 | |
2867 if (r->cache == NULL) { | 2870 if (r->cache == NULL) { |
2868 return NGX_OK; | 2871 return NGX_OK; |
2869 } | 2872 } |
2870 | 2873 |
2871 if (r->cache->valid_sec != 0) { | 2874 if (r->cache->valid_sec != 0) { |
2907 r->upstream->cacheable = 0; | 2910 r->upstream->cacheable = 0; |
2908 return NGX_OK; | 2911 return NGX_OK; |
2909 } | 2912 } |
2910 | 2913 |
2911 r->cache->valid_sec = ngx_time() + n; | 2914 r->cache->valid_sec = ngx_time() + n; |
2915 } | |
2916 #endif | |
2917 | |
2912 return NGX_OK; | 2918 return NGX_OK; |
2913 } | 2919 } |
2914 | 2920 |
2915 | 2921 |
2916 static ngx_int_t | 2922 static ngx_int_t |
2917 ngx_http_upstream_process_expires(ngx_http_request_t *r, ngx_table_elt_t *h, | 2923 ngx_http_upstream_process_expires(ngx_http_request_t *r, ngx_table_elt_t *h, |
2918 ngx_uint_t offset) | 2924 ngx_uint_t offset) |
2919 { | 2925 { |
2926 r->upstream->headers_in.expires = h; | |
2927 | |
2928 #if (NGX_HTTP_CACHE) | |
2929 { | |
2920 time_t expires; | 2930 time_t expires; |
2921 | |
2922 r->upstream->headers_in.expires = h; | |
2923 | 2931 |
2924 if (r->cache == NULL) { | 2932 if (r->cache == NULL) { |
2925 return NGX_OK; | 2933 return NGX_OK; |
2926 } | 2934 } |
2927 | 2935 |
2935 r->upstream->cacheable = 0; | 2943 r->upstream->cacheable = 0; |
2936 return NGX_OK; | 2944 return NGX_OK; |
2937 } | 2945 } |
2938 | 2946 |
2939 r->cache->valid_sec = expires; | 2947 r->cache->valid_sec = expires; |
2948 } | |
2949 #endif | |
2940 | 2950 |
2941 return NGX_OK; | 2951 return NGX_OK; |
2942 } | 2952 } |
2943 | 2953 |
2944 | 2954 |
2945 static ngx_int_t | 2955 static ngx_int_t |
2946 ngx_http_upstream_process_accel_expires(ngx_http_request_t *r, | 2956 ngx_http_upstream_process_accel_expires(ngx_http_request_t *r, |
2947 ngx_table_elt_t *h, ngx_uint_t offset) | 2957 ngx_table_elt_t *h, ngx_uint_t offset) |
2948 { | 2958 { |
2959 r->upstream->headers_in.x_accel_expires = h; | |
2960 | |
2961 #if (NGX_HTTP_CACHE) | |
2962 { | |
2949 u_char *p; | 2963 u_char *p; |
2950 size_t len; | 2964 size_t len; |
2951 ngx_int_t n; | 2965 ngx_int_t n; |
2952 | |
2953 r->upstream->headers_in.x_accel_expires = h; | |
2954 | 2966 |
2955 if (r->cache == NULL) { | 2967 if (r->cache == NULL) { |
2956 return NGX_OK; | 2968 return NGX_OK; |
2957 } | 2969 } |
2958 | 2970 |
2980 n = ngx_atoi(p, len); | 2992 n = ngx_atoi(p, len); |
2981 | 2993 |
2982 if (n != NGX_ERROR) { | 2994 if (n != NGX_ERROR) { |
2983 r->cache->valid_sec = n; | 2995 r->cache->valid_sec = n; |
2984 } | 2996 } |
2997 } | |
2998 #endif | |
2985 | 2999 |
2986 return NGX_OK; | 3000 return NGX_OK; |
2987 } | 3001 } |
2988 | 3002 |
2989 | 3003 |