Welcome! Log In Create A New Profile

Advanced

[nginx] Removed extra allocation for $sent_http_last_modified.

Maxim Dounin
October 30, 2013 08:08PM
details: http://hg.nginx.org/nginx/rev/c21e341c51cb
branches:
changeset: 5434:c21e341c51cb
user: Maxim Dounin <mdounin@mdounin.ru>
date: Thu Oct 31 04:02:59 2013 +0400
description:
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.

diffstat:

src/http/ngx_http_variables.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)

diffs (13 lines):

diff --git a/src/http/ngx_http_variables.c b/src/http/ngx_http_variables.c
--- a/src/http/ngx_http_variables.c
+++ b/src/http/ngx_http_variables.c
@@ -1744,8 +1744,7 @@ ngx_http_variable_sent_last_modified(ngx
}

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;
}

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Removed extra allocation for $sent_http_last_modified.

Maxim Dounin 712 October 30, 2013 08:08PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 174
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready