Welcome! Log In Create A New Profile

Advanced

[nginx] Upstream: subrequest_in_memory fix.

Maxim Dounin
September 27, 2013 08:56AM
details: http://hg.nginx.org/nginx/rev/f1caf7b8ae1d
branches:
changeset: 5392:f1caf7b8ae1d
user: Maxim Dounin <mdounin@mdounin.ru>
date: Fri Sep 27 16:50:26 2013 +0400
description:
Upstream: subrequest_in_memory fix.

With previous code only part of u->buffer might be emptied in case
of special responses, resulting in partial responses seen by SSI set
in case of simple protocols, or spurious errors like "upstream sent
invalid chunked response" in case of complex ones.

diffstat:

src/http/ngx_http_upstream.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)

diffs (27 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
@@ -1711,10 +1711,6 @@ ngx_http_upstream_process_header(ngx_htt

if (u->headers_in.status_n >= NGX_HTTP_SPECIAL_RESPONSE) {

- if (r->subrequest_in_memory) {
- u->buffer.last = u->buffer.pos;
- }
-
if (ngx_http_upstream_test_next(r, u) == NGX_OK) {
return;
}
@@ -3464,6 +3460,12 @@ ngx_http_upstream_finalize_request(ngx_h

#endif

+ if (r->subrequest_in_memory
+ && u->headers_in.status_n >= NGX_HTTP_SPECIAL_RESPONSE)
+ {
+ u->buffer.last = u->buffer.pos;
+ }
+
if (rc == NGX_DECLINED) {
return;
}

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

[nginx] Upstream: subrequest_in_memory fix.

Maxim Dounin 636 September 27, 2013 08:56AM



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

Online Users

Guests: 126
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready