comparison src/http/ngx_http_variables.c @ 5434:c21e341c51cb

Removed extra allocation for $sent_http_last_modified. There is no need to allocate memory for "Last-Modified: " string, the variable only contains date itself.
author Maxim Dounin <mdounin@mdounin.ru>
date Thu, 31 Oct 2013 04:02:59 +0400
parents 7094d6da2806
children 30e806b8636a
comparison
equal deleted inserted replaced
5433:c37f34bda5ea 5434:c21e341c51cb
1742 1742
1743 return NGX_OK; 1743 return NGX_OK;
1744 } 1744 }
1745 1745
1746 if (r->headers_out.last_modified_time >= 0) { 1746 if (r->headers_out.last_modified_time >= 0) {
1747 p = ngx_pnalloc(r->pool, 1747 p = ngx_pnalloc(r->pool, sizeof("Mon, 28 Sep 1970 06:00:00 GMT") - 1);
1748 sizeof("Last-Modified: Mon, 28 Sep 1970 06:00:00 GMT") - 1);
1749 if (p == NULL) { 1748 if (p == NULL) {
1750 return NGX_ERROR; 1749 return NGX_ERROR;
1751 } 1750 }
1752 1751
1753 v->len = ngx_http_time(p, r->headers_out.last_modified_time) - p; 1752 v->len = ngx_http_time(p, r->headers_out.last_modified_time) - p;