Welcome! Log In Create A New Profile

Advanced

Re: unparsed_uri setting in ngx_http_subrequest?

Brian Pane
February 27, 2010 12:42PM
I think I've found a separate bug in ngx_http_subrequest:

ngx_http_core_module.c, line 2080 (in 0.8.33):
sr->headers_in = r->headers_in;

This results in a bitwise copy of headers_in from the parent request
to the subrequest. Inside headers_in is a list:
typedef struct {
ngx_list_t headers;
// ...
} ngx_http_headers_in_t;

When you do a bitwise copy of an ngx_list_t, you end up with a broken
list. Specifically, sr->headers_in->list->last in the subrequest
points to the last node in the r->headers_in.list.part chain in the
parent request. It should instead point to the last node in the
subrequest's sr->headers_in.list.part chain.

Thus if any module attempts to add more headers to the subrequest's
sr->headers_in, they actually will be added to the parent request's
r->headers_in instead.

I ran into this problem in a module that needs to add extra request
headers to a proxied subrequest.

-Brian

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

unparsed_uri setting in ngx_http_subrequest?

Brian Pane 2848 February 26, 2010 03:00PM

Re: unparsed_uri setting in ngx_http_subrequest?

agentzh 1060 February 26, 2010 11:04PM

Re: unparsed_uri setting in ngx_http_subrequest?

Maxim Dounin 1289 February 27, 2010 06:18AM

Re: unparsed_uri setting in ngx_http_subrequest?

Brian Pane 1071 February 27, 2010 12:42PM

Re: unparsed_uri setting in ngx_http_subrequest?

Maxim Dounin 927 February 27, 2010 01:18PM

Re: unparsed_uri setting in ngx_http_subrequest?

Brian Pane 1238 February 27, 2010 01:36PM

Re: unparsed_uri setting in ngx_http_subrequest?

Maxim Dounin 1020 February 27, 2010 01:58PM

Re: unparsed_uri setting in ngx_http_subrequest?

Brian Pane 1376 February 27, 2010 02:26PM



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

Online Users

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