From 482ec80d5368f6f557df1c7d223745519c856787 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=91=A3=E5=AE=87?= <fishgege@users.noreply.github.com>
Date: Tue, 29 Aug 2017 17:12:09 +0800
Subject: [PATCH] =?UTF-8?q?fix=20a=20bug=20that=20in=20the=20function=20ng?=
=?UTF-8?q?x=5Fhttp=5Fsubrequest,=20it=20will=20make=20the=20headers=5Fin.?=
=?UTF-8?q?headers=20=20incorrect=EF=BC=8Cand=20it=20will=20cause=20many?=
=?UTF-8?q?=20problems?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
//sr->headers_in = r->headers_in;
This line of code copy the headers but make the struct mistake that sr->headers_in.headers.last mismatch &sr->headers_in.headers.part, if somewhere use sr->headers_in.headers.last ,it will cause assert or some other problems。fx:in the function ngx_http_headers_more_assert
so I update for this.
---
src/http/ngx_http_core_module.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index 57a4742..a8da796 100644
|
a
|
b
|
ngx_http_subrequest(ngx_http_request_t *r,
|
| 2274 | 2274 | sr->pool = r->pool; |
| 2275 | 2275 | |
| 2276 | 2276 | sr->headers_in = r->headers_in; |
| 2277 | | |
| | 2277 | sr->headers_in.headers.last = &sr->headers_in.headers.part; |
| | 2278 | |
| 2278 | 2279 | ngx_http_clear_content_length(sr); |
| 2279 | 2280 | ngx_http_clear_accept_ranges(sr); |
| 2280 | 2281 | ngx_http_clear_last_modified(sr); |