Welcome! Log In Create A New Profile

Advanced

[nginx] Upstream: unconditional parsing of last_modified_time.

Maxim Dounin
August 23, 2017 12:22PM
details: http://hg.nginx.org/nginx/rev/acc2cddc7b45
branches:
changeset: 7093:acc2cddc7b45
user: Maxim Dounin <mdounin@mdounin.ru>
date: Wed Aug 23 19:20:06 2017 +0300
description:
Upstream: unconditional parsing of last_modified_time.

This fixes at least the following cases, where no last_modified_time
(assuming caching is not enabled) resulted in incorrect behaviour:

- slice filter and If-Range requests (ticket #1357);
- If-Range requests with proxy_force_ranges;
- expires modified.

diffstat:

src/http/ngx_http_upstream.c | 20 +++-----------------
1 files changed, 3 insertions(+), 17 deletions(-)

diffs (38 lines):

diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -4390,15 +4390,8 @@ ngx_http_upstream_process_last_modified(
u = r->upstream;

u->headers_in.last_modified = h;
-
-#if (NGX_HTTP_CACHE)
-
- if (u->cacheable) {
- u->headers_in.last_modified_time = ngx_parse_http_time(h->value.data,
- h->value.len);
- }
-
-#endif
+ u->headers_in.last_modified_time = ngx_parse_http_time(h->value.data,
+ h->value.len);

return NGX_OK;
}
@@ -4940,15 +4933,8 @@ ngx_http_upstream_copy_last_modified(ngx
*ho = *h;

r->headers_out.last_modified = ho;
-
-#if (NGX_HTTP_CACHE)
-
- if (r->upstream->cacheable) {
- r->headers_out.last_modified_time =
+ r->headers_out.last_modified_time =
r->upstream->headers_in.last_modified_time;
- }
-
-#endif

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

[nginx] Upstream: unconditional parsing of last_modified_time.

Maxim Dounin 499 August 23, 2017 12:22PM



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

Online Users

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