Welcome! Log In Create A New Profile

Advanced

Issue in ngx_http_parse_request_line

December 15, 2014 07:45AM
Hi,
I can see an issue in assigning the port_start and port_end members of ngx_http_request_t inside ngx_http_parse_request_line().
If the request line has a absolute URI with explicit port specified, then port_end is set correctly inside ngx_http_parse_request_line():
...
case sw_port:
if (ch >= '0' && ch <= '9') {
break;
}

switch (ch) {
case '/':
r->port_end = p;
r->uri_start = p;
state = sw_after_slash_in_uri;
break;
...

However, r->port_start is still 0.
I think the following code should be modified:
...
case sw_host_end:

r->host_end = p;

switch (ch) {
case ':':
+ r->port_start = (p + 1);
state = sw_port;
break;
...

Let me know if it sounds OK.
Regards,
-anirudh
Subject Author Posted

Issue in ngx_http_parse_request_line

akamatgi December 15, 2014 07:45AM

Re: Issue in ngx_http_parse_request_line

Valentin V. Bartenev December 15, 2014 08:02AM

Re: Issue in ngx_http_parse_request_line

Maxim Dounin December 15, 2014 08:06AM

Re: Issue in ngx_http_parse_request_line

akamatgi December 16, 2014 12:58AM

Re: Issue in ngx_http_parse_request_line

Valentin V. Bartenev December 16, 2014 05:20AM

Re: Issue in ngx_http_parse_request_line

akamatgi December 16, 2014 08:23AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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