Welcome! Log In Create A New Profile

Advanced

[PATCH] Core: fixed inconsistent state of subrequest's headers_in list

Jan Prachař
November 26, 2020 03:12PM
# HG changeset patch
# User Jan Prachař <jan.prachar@gmail.com>
# Date 1606420825 -3600
# Thu Nov 26 21:00:25 2020 +0100
# Node ID cf3d537ec6706f8713a757df256f2cfccb8f9b01
# Parent e35b529b03781e64912e0d8a72bd0f957dc08cd2
Core: fixed inconsistent state of subrequest's headers_in list

When copying structure ngx_list_t, a reference to the last part need to be
updated, if list contains only one part.

This fixes an issue, when adding a header to the subrequest's headers_in list
has no effect.

diff -r e35b529b0378 -r cf3d537ec670 src/core/ngx_list.h
--- a/src/core/ngx_list.h Mon Sep 21 19:49:49 2020 +0200
+++ b/src/core/ngx_list.h Thu Nov 26 21:00:25 2020 +0100
@@ -51,6 +51,15 @@
return NGX_OK;
}

+static ngx_inline void
+ngx_list_copy(ngx_list_t *target, ngx_list_t *src)
+{
+ *target = *src;
+ if (target->part.next == NULL) {
+ target->last = &target->part;
+ }
+}
+

/*
*
diff -r e35b529b0378 -r cf3d537ec670 src/http/ngx_http_core_module.c
--- a/src/http/ngx_http_core_module.c Mon Sep 21 19:49:49 2020 +0200
+++ b/src/http/ngx_http_core_module.c Thu Nov 26 21:00:25 2020 +0100
@@ -2364,6 +2364,7 @@
sr->pool = r->pool;

sr->headers_in = r->headers_in;
+ ngx_list_copy(&sr->headers_in.headers, &r->headers_in.headers);

ngx_http_clear_content_length(sr);
ngx_http_clear_accept_ranges(sr);

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

[PATCH] Core: fixed inconsistent state of subrequest's headers_in list

Jan Prachař 136 November 26, 2020 03:12PM

Re: [PATCH] Core: fixed inconsistent state of subrequest's headers_in list

Maxim Dounin 18 November 27, 2020 12:44PM

Re: [PATCH] Core: fixed inconsistent state of subrequest's headers_in list

Jan Prachař 19 November 27, 2020 01:12PM

Re: [PATCH] Core: fixed inconsistent state of subrequest's headers_in list

Maxim Dounin 34 November 27, 2020 03:40PM



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

Online Users

Guests: 50
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready