]> git.kaiwu.me - nginx.git/commitdiff
use ngx_http_test_predicates(), ngx_http_set_predicate_slot()
authorIgor Sysoev <igor@sysoev.ru>
Wed, 14 Jul 2010 11:15:45 +0000 (11:15 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Wed, 14 Jul 2010 11:15:45 +0000 (11:15 +0000)
delete ngx_http_cache(), ngx_http_no_cache_set_slot()

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

index 16d2bf8a0ef4bb98e8b45e21a2d7308094c47e3e..81a3a014c79f37bd807b2c52ec3717850eaccdc0 100644 (file)
@@ -332,7 +332,7 @@ static ngx_command_t  ngx_http_fastcgi_commands[] = {
 
     { 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 },
index fcae88e12ebe64c045fd5dc69e7edc47cbdb58c5..c1ae68191e2540eadddd932fbfed302c571d48e9 100644 (file)
@@ -341,7 +341,7 @@ static ngx_command_t  ngx_http_proxy_commands[] = {
 
     { 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 },
index c6d848e4b53b01fad47262da5ab29126489edd0a..11d3610a4636349d8f94859086489a0eb010f7d1 100644 (file)
@@ -198,7 +198,7 @@ static ngx_command_t ngx_http_scgi_commands[] = {
 
     { 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 },
index 466d34be0ae7c465bdd9dff1ecd4177e14852273..d46c8f3713b3f8ec2774e522f2b7fc686e7ea447 100644 (file)
@@ -225,7 +225,7 @@ static ngx_command_t ngx_http_uwsgi_commands[] = {
 
     { 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 },
index 8f0032921b2823635baa271d4f1e64326d565e39..ad5f1356b2deccdcf1f1bd1ea6c167795ba94bf7 100644 (file)
@@ -134,10 +134,6 @@ char *ngx_http_file_cache_set_slot(ngx_conf_t *cf, ngx_command_t *cmd,
 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[];
 
index 44b8b947c9973904c61bf8a13b4d96b4f65747d3..ede6d2ad5d1a6a3baae509cffea548a855e254b4 100644 (file)
@@ -633,11 +633,9 @@ ngx_http_upstream_cache(ngx_http_request_t *r, ngx_http_upstream_t *u)
 
     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)) {