diff src/http/ngx_http_variables.c @ 340:10cc350ed8a1 NGINX_0_6_14

nginx 0.6.14 *) Change: now by default the "echo" SSI command uses entity encoding. *) Feature: the "encoding" parameter in the "echo" SSI command. *) Feature: the "access_log" directive may be used inside the "limit_except" block. *) Bugfix: if all upstream servers were failed, then all servers had got weight the was equal one until servers became alive; bug appeared in 0.6.6. *) Bugfix: a segmentation fault occurred in worker process if $date_local and $date_gmt were used outside the ngx_http_ssi_filter_module. *) Bugfix: a segmentation fault might occur in worker process if debug log was enabled. Thanks to Andrei Nigmatulin. *) Bugfix: ngx_http_memcached_module did not set $upstream_response_time. Thanks to Maxim Dounin. *) Bugfix: a worker process may got caught in an endless loop, if the memcached was used. *) Bugfix: nginx supported low case only "close" and "keep-alive" values in the "Connection" request header line; bug appeared in 0.6.11. *) Bugfix: sub_filter did not work with empty substitution. *) Bugfix: in sub_filter parsing.
author Igor Sysoev <http://sysoev.ru>
date Mon, 15 Oct 2007 00:00:00 +0400
parents f7cd062ee035
children 54fad6c4b555
line wrap: on
line diff
--- a/src/http/ngx_http_variables.c
+++ b/src/http/ngx_http_variables.c
@@ -143,34 +143,34 @@ static ngx_http_variable_t  ngx_http_cor
 
     { ngx_string("uri"), NULL, ngx_http_variable_request,
       offsetof(ngx_http_request_t, uri),
-      NGX_HTTP_VAR_NOCACHABLE, 0 },
+      NGX_HTTP_VAR_NOCACHEABLE, 0 },
 
     { ngx_string("document_uri"), NULL, ngx_http_variable_request,
       offsetof(ngx_http_request_t, uri),
-      NGX_HTTP_VAR_NOCACHABLE, 0 },
+      NGX_HTTP_VAR_NOCACHEABLE, 0 },
 
     { ngx_string("request"), NULL, ngx_http_variable_request,
       offsetof(ngx_http_request_t, request_line), 0, 0 },
 
     { ngx_string("document_root"), NULL,
-      ngx_http_variable_document_root, 0, NGX_HTTP_VAR_NOCACHABLE, 0 },
+      ngx_http_variable_document_root, 0, NGX_HTTP_VAR_NOCACHEABLE, 0 },
 
     { ngx_string("query_string"), NULL, ngx_http_variable_request,
       offsetof(ngx_http_request_t, args),
-      NGX_HTTP_VAR_NOCACHABLE, 0 },
+      NGX_HTTP_VAR_NOCACHEABLE, 0 },
 
     { ngx_string("args"),
       ngx_http_variable_request_set,
       ngx_http_variable_request,
       offsetof(ngx_http_request_t, args),
-      NGX_HTTP_VAR_CHANGABLE|NGX_HTTP_VAR_NOCACHABLE, 0 },
+      NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_NOCACHEABLE, 0 },
 
     { ngx_string("is_args"), NULL, ngx_http_variable_is_args,
-      0, NGX_HTTP_VAR_NOCACHABLE, 0 },
+      0, NGX_HTTP_VAR_NOCACHEABLE, 0 },
 
     { ngx_string("request_filename"), NULL,
       ngx_http_variable_request_filename, 0,
-      NGX_HTTP_VAR_NOCACHABLE, 0 },
+      NGX_HTTP_VAR_NOCACHEABLE, 0 },
 
     { ngx_string("server_name"), NULL, ngx_http_variable_request,
       offsetof(ngx_http_request_t, server_name), 0, 0 },
@@ -215,7 +215,7 @@ static ngx_http_variable_t  ngx_http_cor
     { ngx_string("limit_rate"), ngx_http_variable_request_set_size,
       ngx_http_variable_request,
       offsetof(ngx_http_request_t, limit_rate),
-      NGX_HTTP_VAR_CHANGABLE|NGX_HTTP_VAR_NOCACHABLE, 0 },
+      NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_NOCACHEABLE, 0 },
 
     { ngx_string("nginx_version"), NULL, ngx_http_variable_nginx_version,
       0, 0, 0 },
@@ -251,7 +251,7 @@ ngx_http_add_variable(ngx_conf_t *cf, ng
 
         v = key[i].value;
 
-        if (!(v->flags & NGX_HTTP_VAR_CHANGABLE)) {
+        if (!(v->flags & NGX_HTTP_VAR_CHANGEABLE)) {
             ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
                                "the duplicate \"%V\" variable", name);
             return NULL;
@@ -375,8 +375,8 @@ ngx_http_get_indexed_variable(ngx_http_r
     if (v[index].get_handler(r, &r->variables[index], v[index].data)
         == NGX_OK)
     {
-        if (v[index].flags & NGX_HTTP_VAR_NOCACHABLE) {
-            r->variables[index].no_cachable = 1;
+        if (v[index].flags & NGX_HTTP_VAR_NOCACHEABLE) {
+            r->variables[index].no_cacheable = 1;
         }
 
         return &r->variables[index];
@@ -397,7 +397,7 @@ ngx_http_get_flushed_variable(ngx_http_r
     v = &r->variables[index];
 
     if (v->valid) {
-        if (!v->no_cachable) {
+        if (!v->no_cacheable) {
             return v;
         }
 
@@ -497,7 +497,7 @@ ngx_http_variable_request(ngx_http_reque
     if (s->data) {
         v->len = s->len;
         v->valid = 1;
-        v->no_cachable = 0;
+        v->no_cacheable = 0;
         v->not_found = 0;
         v->data = s->data;
 
@@ -559,7 +559,7 @@ ngx_http_variable_header(ngx_http_reques
     if (h) {
         v->len = h->value.len;
         v->valid = 1;
-        v->no_cachable = 0;
+        v->no_cacheable = 0;
         v->not_found = 0;
         v->data = h->value.data;
 
@@ -591,7 +591,7 @@ ngx_http_variable_headers(ngx_http_reque
     }
 
     v->valid = 1;
-    v->no_cachable = 0;
+    v->no_cacheable = 0;
     v->not_found = 0;
 
     h = a->elts;
@@ -691,7 +691,7 @@ ngx_http_variable_unknown_header(ngx_htt
         if (n + prefix == var->len && n == header[i].key.len) {
             v->len = header[i].value.len;
             v->valid = 1;
-            v->no_cachable = 0;
+            v->no_cacheable = 0;
             v->not_found = 0;
             v->data = header[i].value.data;
 
@@ -730,7 +730,7 @@ ngx_http_variable_host(ngx_http_request_
     }
 
     v->valid = 1;
-    v->no_cachable = 0;
+    v->no_cacheable = 0;
     v->not_found = 0;
 
     return NGX_OK;
@@ -749,7 +749,7 @@ ngx_http_variable_binary_remote_addr(ngx
 
     v->len = sizeof(in_addr_t);
     v->valid = 1;
-    v->no_cachable = 0;
+    v->no_cacheable = 0;
     v->not_found = 0;
     v->data = (u_char *) &sin->sin_addr.s_addr;
 
@@ -763,7 +763,7 @@ ngx_http_variable_remote_addr(ngx_http_r
 {
     v->len = r->connection->addr_text.len;
     v->valid = 1;
-    v->no_cachable = 0;
+    v->no_cacheable = 0;
     v->not_found = 0;
     v->data = r->connection->addr_text.data;
 
@@ -780,7 +780,7 @@ ngx_http_variable_remote_port(ngx_http_r
 
     v->len = 0;
     v->valid = 1;
-    v->no_cachable = 0;
+    v->no_cacheable = 0;
     v->not_found = 0;
 
     v->data = ngx_palloc(r->pool, sizeof("65535") - 1);
@@ -832,7 +832,7 @@ ngx_http_variable_server_addr(ngx_http_r
     v->len = ngx_inet_ntop(c->listening->family, &r->in_addr,
                            v->data, INET_ADDRSTRLEN);
     v->valid = 1;
-    v->no_cachable = 0;
+    v->no_cacheable = 0;
     v->not_found = 0;
 
     return NGX_OK;
@@ -845,7 +845,7 @@ ngx_http_variable_server_port(ngx_http_r
 {
     v->len = r->port_text->len - 1;
     v->valid = 1;
-    v->no_cachable = 0;
+    v->no_cacheable = 0;
     v->not_found = 0;
     v->data = r->port_text->data + 1;
 
@@ -862,7 +862,7 @@ ngx_http_variable_scheme(ngx_http_reques
     if (r->connection->ssl) {
         v->len = sizeof("https") - 1;
         v->valid = 1;
-        v->no_cachable = 0;
+        v->no_cacheable = 0;
         v->not_found = 0;
         v->data = (u_char *) "https";
 
@@ -873,7 +873,7 @@ ngx_http_variable_scheme(ngx_http_reques
 
     v->len = sizeof("http") - 1;
     v->valid = 1;
-    v->no_cachable = 0;
+    v->no_cacheable = 0;
     v->not_found = 0;
     v->data = (u_char *) "http";
 
@@ -886,7 +886,7 @@ ngx_http_variable_is_args(ngx_http_reque
     ngx_http_variable_value_t *v, uintptr_t data)
 {
     v->valid = 1;
-    v->no_cachable = 0;
+    v->no_cacheable = 0;
     v->not_found = 0;
 
     if (r->args.len == 0) {
@@ -914,7 +914,7 @@ ngx_http_variable_document_root(ngx_http
     if (clcf->root_lengths == NULL) {
         v->len = clcf->root.len;
         v->valid = 1;
-        v->no_cachable = 0;
+        v->no_cacheable = 0;
         v->not_found = 0;
         v->data = clcf->root.data;
 
@@ -934,7 +934,7 @@ ngx_http_variable_document_root(ngx_http
 
         v->len = path.len;
         v->valid = 1;
-        v->no_cachable = 0;
+        v->no_cacheable = 0;
         v->not_found = 0;
         v->data = path.data;
     }
@@ -958,7 +958,7 @@ ngx_http_variable_request_filename(ngx_h
 
     v->len = path.len - 1;
     v->valid = 1;
-    v->no_cachable = 0;
+    v->no_cacheable = 0;
     v->not_found = 0;
     v->data = path.data;
 
@@ -973,7 +973,7 @@ ngx_http_variable_request_method(ngx_htt
     if (r->main->method_name.data) {
         v->len = r->main->method_name.len;
         v->valid = 1;
-        v->no_cachable = 0;
+        v->no_cacheable = 0;
         v->not_found = 0;
         v->data = r->main->method_name.data;
 
@@ -1004,7 +1004,7 @@ ngx_http_variable_remote_user(ngx_http_r
 
     v->len = r->headers_in.user.len;
     v->valid = 1;
-    v->no_cachable = 0;
+    v->no_cacheable = 0;
     v->not_found = 0;
     v->data = r->headers_in.user.data;
 
@@ -1032,7 +1032,7 @@ ngx_http_variable_body_bytes_sent(ngx_ht
 
     v->len = ngx_sprintf(p, "%O", sent) - p;
     v->valid = 1;
-    v->no_cachable = 0;
+    v->no_cacheable = 0;
     v->not_found = 0;
     v->data = p;
 
@@ -1047,7 +1047,7 @@ ngx_http_variable_sent_content_type(ngx_
     if (r->headers_out.content_type.len) {
         v->len = r->headers_out.content_type.len;
         v->valid = 1;
-        v->no_cachable = 0;
+        v->no_cacheable = 0;
         v->not_found = 0;
         v->data = r->headers_out.content_type.data;
 
@@ -1068,7 +1068,7 @@ ngx_http_variable_sent_content_length(ng
     if (r->headers_out.content_length) {
         v->len = r->headers_out.content_length->value.len;
         v->valid = 1;
-        v->no_cachable = 0;
+        v->no_cacheable = 0;
         v->not_found = 0;
         v->data = r->headers_out.content_length->value.data;
 
@@ -1083,7 +1083,7 @@ ngx_http_variable_sent_content_length(ng
 
         v->len = ngx_sprintf(p, "%O", r->headers_out.content_length_n) - p;
         v->valid = 1;
-        v->no_cachable = 0;
+        v->no_cacheable = 0;
         v->not_found = 0;
         v->data = p;
 
@@ -1105,7 +1105,7 @@ ngx_http_variable_sent_last_modified(ngx
     if (r->headers_out.last_modified) {
         v->len = r->headers_out.last_modified->value.len;
         v->valid = 1;
-        v->no_cachable = 0;
+        v->no_cacheable = 0;
         v->not_found = 0;
         v->data = r->headers_out.last_modified->value.data;
 
@@ -1121,7 +1121,7 @@ ngx_http_variable_sent_last_modified(ngx
 
         v->len = ngx_http_time(p, r->headers_out.last_modified_time) - p;
         v->valid = 1;
-        v->no_cachable = 0;
+        v->no_cacheable = 0;
         v->not_found = 0;
         v->data = p;
 
@@ -1152,7 +1152,7 @@ ngx_http_variable_sent_connection(ngx_ht
 
     v->len = len;
     v->valid = 1;
-    v->no_cachable = 0;
+    v->no_cacheable = 0;
     v->not_found = 0;
     v->data = (u_char *) p;
 
@@ -1179,7 +1179,7 @@ ngx_http_variable_sent_keep_alive(ngx_ht
 
             v->len = ngx_sprintf(p, "timeout=%T", clcf->keepalive_header) - p;
             v->valid = 1;
-            v->no_cachable = 0;
+            v->no_cacheable = 0;
             v->not_found = 0;
             v->data = p;
 
@@ -1200,7 +1200,7 @@ ngx_http_variable_sent_transfer_encoding
     if (r->chunked) {
         v->len = sizeof("chunked") - 1;
         v->valid = 1;
-        v->no_cachable = 0;
+        v->no_cacheable = 0;
         v->not_found = 0;
         v->data = (u_char *) "chunked";
 
@@ -1219,7 +1219,7 @@ ngx_http_variable_request_completion(ngx
     if (r->request_complete) {
         v->len = 2;
         v->valid = 1;
-        v->no_cachable = 0;
+        v->no_cacheable = 0;
         v->not_found = 0;
         v->data = (u_char *) "OK";
 
@@ -1228,7 +1228,7 @@ ngx_http_variable_request_completion(ngx
 
     v->len = 0;
     v->valid = 1;
-    v->no_cachable = 0;
+    v->no_cacheable = 0;
     v->not_found = 0;
     v->data = (u_char *) "";
 
@@ -1248,7 +1248,7 @@ ngx_http_variable_request_body_file(ngx_
 
     v->len = r->request_body->temp_file->file.name.len;
     v->valid = 1;
-    v->no_cachable = 0;
+    v->no_cacheable = 0;
     v->not_found = 0;
     v->data = r->request_body->temp_file->file.name.data;
 
@@ -1262,7 +1262,7 @@ ngx_http_variable_nginx_version(ngx_http
 {
     v->len = sizeof(NGINX_VERSION) - 1;
     v->valid = 1;
-    v->no_cachable = 0;
+    v->no_cacheable = 0;
     v->not_found = 0;
     v->data = (u_char *) NGINX_VERSION;
 
@@ -1370,7 +1370,7 @@ ngx_http_variables_init_vars(ngx_conf_t 
         if (ngx_strncmp(v[i].name.data, "upstream_http_", 14) == 0) {
             v[i].get_handler = ngx_http_upstream_header_variable;
             v[i].data = (uintptr_t) &v[i].name;
-            v[i].flags = NGX_HTTP_VAR_NOCACHABLE;
+            v[i].flags = NGX_HTTP_VAR_NOCACHEABLE;
 
             continue;
         }