Welcome! Log In Create A New Profile

Advanced

[PATCH] Handling of If-Range with add_header Last-Modified

Maxim Dounin
September 06, 2011 07:58AM
# HG changeset patch
# User Maxim Dounin <mdounin@mdounin.ru>
# Date 1315291748 -14400
# Node ID e51619385db9694030b9614c833a2b2504b377c9
# Parent 014764a85840606c90317e9f44f2b9fa139cbc8b
Handling of If-Range with add_header Last-Modified.

diff --git a/src/http/modules/ngx_http_headers_filter_module.c b/src/http/modules/ngx_http_headers_filter_module.c
--- a/src/http/modules/ngx_http_headers_filter_module.c
+++ b/src/http/modules/ngx_http_headers_filter_module.c
@@ -369,7 +369,8 @@ ngx_http_set_last_modified(ngx_http_requ
old = NULL;
}

- r->headers_out.last_modified_time = -1;
+ r->headers_out.last_modified_time = ngx_http_parse_time(value->data,
+ value->len);

if (old == NULL || *old == NULL) {

@@ -382,6 +383,8 @@ ngx_http_set_last_modified(ngx_http_requ
return NGX_ERROR;
}

+ *old = h;
+
} else {
h = *old;

diff --git a/src/http/modules/ngx_http_range_filter_module.c b/src/http/modules/ngx_http_range_filter_module.c
--- a/src/http/modules/ngx_http_range_filter_module.c
+++ b/src/http/modules/ngx_http_range_filter_module.c
@@ -173,7 +173,11 @@ ngx_http_range_header_filter(ngx_http_re
goto next_filter;
}

- if (r->headers_in.if_range && r->headers_out.last_modified_time != -1) {
+ if (r->headers_in.if_range) {
+
+ if (r->headers_out.last_modified_time == (time_t) -1) {
+ goto next_filter;
+ }

if_range = ngx_http_parse_time(r->headers_in.if_range->value.data,
r->headers_in.if_range->value.len);

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

[PATCH] Handling of If-Range with add_header Last-Modified

Maxim Dounin 2312 September 06, 2011 07:58AM



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

Online Users

Guests: 285
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