Welcome! Log In Create A New Profile

Advanced

Re: Strange behavior (BUG?) for setting r->headers_in.method_name in a subrequest

Mirko Dziadzka
August 31, 2010 04:00AM
Hi

On 30.08.2010, at 21:00, Maxim Dounin wrote:
> On Mon, Aug 30, 2010 at 06:31:13PM +0200, Mirko Dziadzka wrote:
>>
>> res = ngx_http_subrequest(r, uri, NULL , &sr, psr, flags);
>> sr->method = NGX_HTTP_POST;
>> sr->method_name.data = (u_char *)"POST "; // note the SPACE after POST
>> sr->method_name.len = 4;
>>
>> it will work as expected and I see a space. I did not dig further into
>> nginx code but it looks like the 5-th byte from "POST" is used in the
>> new request - which is probably a bug.
>
> r->method_name expected to point into request line, and the use of
> the following byte is intentional.

I see.

What is the recommended way to create a POST sub-request?
Should I create a new request line and let uri and method_name point to this line?

like:

u_char * request_line = "POST /foo HTTP/1.0";
ngx_str_t uri;
ngx_str_t method_name;
method_name.data = request_line;
method_name.len = 4;
uri.data = request_line + 5;
uri.len = 4;


Greetings

Mirko






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

Strange behavior (BUG?) for setting r->headers_in.method_name in a subrequest

Mirko Dziadzka 1858 August 30, 2010 12:32PM

Re: Strange behavior (BUG?) for setting r->headers_in.method_name in a subrequest

Maxim Dounin 691 August 30, 2010 03:02PM

Re: Strange behavior (BUG?) for setting r->headers_in.method_name in a subrequest

Mirko Dziadzka 552 August 31, 2010 04:00AM

Re: Strange behavior (BUG?) for setting r->headers_in.method_namein a subrequest

Piotr Sikora 824 August 31, 2010 04:30AM



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

Online Users

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