diff src/http/modules/ngx_http_headers_filter_module.c @ 348:e10168d6e371 NGINX_0_6_18

nginx 0.6.18 *) Change: now the ngx_http_userid_module adds start time microseconds to the cookie field contains a pid value. *) Change: now the full request line instead of URI only is written to error_log. *) Feature: variables support in the "proxy_pass" directive. *) Feature: the "resolver" and "resolver_timeout" directives. *) Feature: now the directive "add_header last-modified ''" deletes a "Last-Modified" response header line. *) Bugfix: the "limit_rate" directive did not allow to use full throughput, even if limit value was very high.
author Igor Sysoev <http://sysoev.ru>
date Tue, 27 Nov 2007 00:00:00 +0300
parents 9fc4ab6673f9
children d13234035cad
line wrap: on
line diff
--- a/src/http/modules/ngx_http_headers_filter_module.c
+++ b/src/http/modules/ngx_http_headers_filter_module.c
@@ -369,7 +369,14 @@ ngx_http_set_last_modified(ngx_http_requ
         old = NULL;
     }
 
+    r->headers_out.last_modified_time = -1;
+
     if (old == NULL || *old == NULL) {
+
+        if (value->len == 0) {
+            return NGX_OK;
+        }
+
         h = ngx_list_push(&r->headers_out.headers);
         if (h == NULL) {
             return NGX_ERROR;
@@ -377,14 +384,17 @@ ngx_http_set_last_modified(ngx_http_requ
 
     } else {
         h = *old;
+
+        if (value->len == 0) {
+            h->hash = 0;
+            return NGX_OK;
+        }
     }
 
     h->hash = hv->value.hash;
     h->key = hv->value.key;
     h->value = *value;
 
-    r->headers_out.last_modified_time = -1;
-
     return NGX_OK;
 }