comparison src/core/ngx_inet.c @ 569:174f1e853e1e release-0.3.6

nginx-0.3.6-RELEASE import *) Change: now the IMAP/POP3 proxy do not send the empty login to authorization server. *) Feature: the "log_format" supports the variables in the $name form. *) Bugfix: if at least in one server was no the "listen" directive, then nginx did not listen on the 80 port; the bug had appeared in 0.3.3. *) Bugfix: if the URI part is omitted in "proxy_pass" directive, the the 80 port was always used.
author Igor Sysoev <igor@sysoev.ru>
date Mon, 24 Oct 2005 15:09:41 +0000
parents e48ebafc6939
children 4d9ea73a627a
comparison
equal deleted inserted replaced
568:91e400506e99 569:174f1e853e1e
450 450
451 break; 451 break;
452 } 452 }
453 } 453 }
454 454
455 if (u->port_text.data == NULL) { 455 if (u->port_text.data) {
456
457 if (u->port_text.len == 0) {
458 u->port_text.len = &url->data[i] - u->port_text.data;
459
460 if (u->port_text.len == 0) {
461 return "invalid port";
462 }
463 }
464
465 port = ngx_atoi(u->port_text.data, u->port_text.len);
466
467 if (port == NGX_ERROR || port < 1 || port > 65536) {
468 return "invalid port";
469 }
470
471 } else {
456 port = ngx_atoi(url->data, url->len); 472 port = ngx_atoi(url->data, url->len);
457 473
458 if (port == NGX_ERROR) { 474 if (port == NGX_ERROR) {
459 u->default_port = 1; 475 u->default_port = 1;
460 u->host.len = url->len; 476 u->host.len = url->len;
462 return NULL; 478 return NULL;
463 } 479 }
464 480
465 u->port_text = *url; 481 u->port_text = *url;
466 u->wildcard = 1; 482 u->wildcard = 1;
467
468 } else {
469 if (u->port_text.len == 0) {
470 u->default_port = 1;
471 return NULL;
472 }
473
474 port = ngx_atoi(u->port_text.data, u->port_text.len);
475
476 if (port == NGX_ERROR || port < 1 || port > 65536) {
477 return "invalid port";
478 }
479 } 483 }
480 484
481 u->port = (in_port_t) port; 485 u->port = (in_port_t) port;
482 486
483 return NULL; 487 return NULL;