]> git.kaiwu.me - nginx.git/commitdiff
Removed extra allocation for $sent_http_last_modified.
authorMaxim Dounin <mdounin@mdounin.ru>
Thu, 31 Oct 2013 00:02:59 +0000 (04:02 +0400)
committerMaxim Dounin <mdounin@mdounin.ru>
Thu, 31 Oct 2013 00:02:59 +0000 (04:02 +0400)
There is no need to allocate memory for "Last-Modified: " string,
the variable only contains date itself.

src/http/ngx_http_variables.c

index 3ec038aef7cbdca4aa83ed61c90719e193e93c39..e49d2023b8e8754eb9058ba4471b50381a083c8e 100644 (file)
@@ -1744,8 +1744,7 @@ ngx_http_variable_sent_last_modified(ngx_http_request_t *r,
     }
 
     if (r->headers_out.last_modified_time >= 0) {
-        p = ngx_pnalloc(r->pool,
-                   sizeof("Last-Modified: Mon, 28 Sep 1970 06:00:00 GMT") - 1);
+        p = ngx_pnalloc(r->pool, sizeof("Mon, 28 Sep 1970 06:00:00 GMT") - 1);
         if (p == NULL) {
             return NGX_ERROR;
         }