changeset 3692:045ea40cbfe8

use ngx_http_test_predicates(), ngx_http_set_predicate_slot() delete ngx_http_cache(), ngx_http_no_cache_set_slot()
author Igor Sysoev <igor@sysoev.ru>
date Wed, 14 Jul 2010 11:15:45 +0000
parents 55f95e91daed
children e3bcc2f4c418
files src/http/modules/ngx_http_fastcgi_module.c src/http/modules/ngx_http_proxy_module.c src/http/modules/ngx_http_scgi_module.c src/http/modules/ngx_http_uwsgi_module.c src/http/ngx_http_cache.h src/http/ngx_http_upstream.c
diffstat 6 files changed, 7 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/src/http/modules/ngx_http_fastcgi_module.c
+++ b/src/http/modules/ngx_http_fastcgi_module.c
@@ -332,7 +332,7 @@ static ngx_command_t  ngx_http_fastcgi_c
 
     { ngx_string("fastcgi_no_cache"),
       NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
-      ngx_http_no_cache_set_slot,
+      ngx_http_set_predicate_slot,
       NGX_HTTP_LOC_CONF_OFFSET,
       offsetof(ngx_http_fastcgi_loc_conf_t, upstream.no_cache),
       NULL },
--- a/src/http/modules/ngx_http_proxy_module.c
+++ b/src/http/modules/ngx_http_proxy_module.c
@@ -341,7 +341,7 @@ static ngx_command_t  ngx_http_proxy_com
 
     { ngx_string("proxy_no_cache"),
       NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
-      ngx_http_no_cache_set_slot,
+      ngx_http_set_predicate_slot,
       NGX_HTTP_LOC_CONF_OFFSET,
       offsetof(ngx_http_proxy_loc_conf_t, upstream.no_cache),
       NULL },
--- a/src/http/modules/ngx_http_scgi_module.c
+++ b/src/http/modules/ngx_http_scgi_module.c
@@ -198,7 +198,7 @@ static ngx_command_t ngx_http_scgi_comma
 
     { ngx_string("scgi_no_cache"),
       NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
-      ngx_http_no_cache_set_slot,
+      ngx_http_set_predicate_slot,
       NGX_HTTP_LOC_CONF_OFFSET,
       offsetof(ngx_http_scgi_loc_conf_t, upstream.no_cache),
       NULL },
--- a/src/http/modules/ngx_http_uwsgi_module.c
+++ b/src/http/modules/ngx_http_uwsgi_module.c
@@ -225,7 +225,7 @@ static ngx_command_t ngx_http_uwsgi_comm
 
     { ngx_string("uwsgi_no_cache"),
       NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
-      ngx_http_no_cache_set_slot,
+      ngx_http_set_predicate_slot,
       NGX_HTTP_LOC_CONF_OFFSET,
       offsetof(ngx_http_uwsgi_loc_conf_t, upstream.no_cache),
       NULL },
--- a/src/http/ngx_http_cache.h
+++ b/src/http/ngx_http_cache.h
@@ -134,10 +134,6 @@ char *ngx_http_file_cache_set_slot(ngx_c
 char *ngx_http_file_cache_valid_set_slot(ngx_conf_t *cf, ngx_command_t *cmd,
     void *conf);
 
-ngx_int_t ngx_http_cache(ngx_http_request_t *r, ngx_array_t *no_cache);
-char *ngx_http_no_cache_set_slot(ngx_conf_t *cf, ngx_command_t *cmd,
-    void *conf);
-
 
 extern ngx_str_t  ngx_http_cache_status[];
 
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -633,11 +633,9 @@ ngx_http_upstream_cache(ngx_http_request
 
     if (c == NULL) {
 
-        if (u->conf->no_cache) {
-            rc = ngx_http_cache(r, u->conf->no_cache);
-            if (rc != NGX_OK) {
-                return rc;
-            }
+        rc = ngx_http_test_predicates(r, u->conf->no_cache);
+        if (rc != NGX_OK) {
+            return rc;
         }
 
         if (!(r->method & u->conf->cache_methods)) {