Ticket #1378: 0001-fix-a-bug-that-in-the-function-ngx_http_subrequest-i.patch

File 0001-fix-a-bug-that-in-the-function-ngx_http_subrequest-i.patch, 1.5 KB (added by fishgege@…, 9 years ago)
  • src/http/ngx_http_core_module.c

    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,  
    22742274    sr->pool = r->pool;
    22752275
    22762276    sr->headers_in = r->headers_in;
    2277 
     2277    sr->headers_in.headers.last = &sr->headers_in.headers.part;
     2278   
    22782279    ngx_http_clear_content_length(sr);
    22792280    ngx_http_clear_accept_ranges(sr);
    22802281    ngx_http_clear_last_modified(sr);