Mercurial > hg > nginx
comparison src/core/ngx_inet.c @ 2283:231b52f8adc0
fix case when URL has no port, but has ":" in URI part,
the bug has been introduced in r2204
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Fri, 24 Oct 2008 15:12:11 +0000 |
parents | 6ea36910aa57 |
children | c3035feb6638 |
comparison
equal
deleted
inserted
replaced
2282:ec97eb9a8038 | 2283:231b52f8adc0 |
---|---|
262 | 262 |
263 last = host + u->url.len; | 263 last = host + u->url.len; |
264 | 264 |
265 port = ngx_strlchr(host, last, ':'); | 265 port = ngx_strlchr(host, last, ':'); |
266 | 266 |
267 uri = ngx_strlchr(port ? port : host, last, '/'); | 267 uri = ngx_strlchr(host, last, '/'); |
268 | 268 |
269 if (uri) { | 269 if (uri) { |
270 if (u->listen || !u->uri_part) { | 270 if (u->listen || !u->uri_part) { |
271 u->err = "invalid host"; | 271 u->err = "invalid host"; |
272 return NGX_ERROR; | 272 return NGX_ERROR; |
274 | 274 |
275 u->uri.len = last - uri; | 275 u->uri.len = last - uri; |
276 u->uri.data = uri; | 276 u->uri.data = uri; |
277 | 277 |
278 last = uri; | 278 last = uri; |
279 | |
280 if (uri < port) { | |
281 port = NULL; | |
282 } | |
279 } | 283 } |
280 | 284 |
281 if (port) { | 285 if (port) { |
282 port++; | 286 port++; |
283 | 287 |