nginx-0.0.10-2004-09-09-19:40:48 import
diff --git a/src/http/modules/proxy/ngx_http_proxy_handler.c b/src/http/modules/proxy/ngx_http_proxy_handler.c
index af9760c..f057d3c 100644
--- a/src/http/modules/proxy/ngx_http_proxy_handler.c
+++ b/src/http/modules/proxy/ngx_http_proxy_handler.c
@@ -1227,7 +1227,8 @@
u->port_text.len = &url->data[i] - u->port_text.data;
if (u->port_text.len > 0) {
- u->port = ngx_atoi(u->port_text.data, u->port_text.len);
+ u->port = (in_port_t) ngx_atoi(u->port_text.data,
+ u->port_text.len);
if (u->port > 0) {
if (u->port == 80) {
@@ -1263,7 +1264,7 @@
u->port_text.len = &url->data[i] - u->port_text.data;
if (u->port_text.len > 0) {
- u->port = ngx_atoi(u->port_text.data, u->port_text.len);
+ u->port = (in_port_t) ngx_atoi(u->port_text.data, u->port_text.len);
if (u->port > 0) {
u->port = htons(u->port);
return NULL;
diff --git a/src/http/ngx_http.c b/src/http/ngx_http.c
index d02b250..391bd1b 100644
--- a/src/http/ngx_http.c
+++ b/src/http/ngx_http.c
@@ -54,10 +54,9 @@
static char *ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
{
+ char *rv;
ngx_uint_t mi, m, s, l, p, a, n;
ngx_uint_t port_found, addr_found, virtual_names;
- char *rv;
- struct sockaddr_in *addr_in;
ngx_conf_t pcf;
ngx_array_t in_ports;
ngx_listening_t *ls;
@@ -514,6 +513,7 @@
ls->nonblocking = 0;
#endif
#endif
+ ls->addr_ntop = 1;
ls->handler = ngx_http_init_connection;
diff --git a/src/http/ngx_http_parse.c b/src/http/ngx_http_parse.c
index 8136f31..dd2d374 100644
--- a/src/http/ngx_http_parse.c
+++ b/src/http/ngx_http_parse.c
@@ -65,19 +65,19 @@
if (r->method_end - m == 3) {
- if (*m == 'G' && *(m + 1) == 'E' && *(m + 2) == 'T') {
+ if (m[0] == 'G' && m[1] == 'E' && m[2] == 'T') {
r->method = NGX_HTTP_GET;
}
} else if (r->method_end - m == 4) {
- if (*m == 'P' && *(m + 1) == 'O'
- && *(m + 2) == 'T' && *(m + 3) == 'T')
+ if (m[0] == 'P' && m[1] == 'O'
+ && m[2] == 'T' && m[3] == 'T')
{
r->method = NGX_HTTP_POST;
- } else if (*m == 'H' && *(m + 1) == 'E'
- && *(m + 2) == 'A' && *(m + 3) == 'D')
+ } else if (m[0] == 'H' && m[1] == 'E'
+ && m[2] == 'A' && m[3] == 'D')
{
r->method = NGX_HTTP_HEAD;
}
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index dcf53d7..a1081af 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -97,21 +97,6 @@
ngx_event_t *rev;
ngx_http_log_ctx_t *ctx;
- c->addr_text.data = ngx_palloc(c->pool, c->listening->addr_text_max_len);
- if (c->addr_text.data == NULL) {
- ngx_http_close_connection(c);
- return;
- }
-
- c->addr_text.len = ngx_sock_ntop(c->listening->family, c->sockaddr,
- c->addr_text.data,
- c->listening->addr_text_max_len);
-
- if (c->addr_text.len == 0) {
- ngx_http_close_connection(c);
- return;
- }
-
if (!(ctx = ngx_pcalloc(c->pool, sizeof(ngx_http_log_ctx_t)))) {
ngx_http_close_connection(c);
return;
diff --git a/src/http/ngx_http_request.h b/src/http/ngx_http_request.h
index abd52bc..cc0cbbf 100644
--- a/src/http/ngx_http_request.h
+++ b/src/http/ngx_http_request.h
@@ -311,7 +311,7 @@
ngx_uint_t headers_n;
/* used to parse HTTP headers */
- ngx_int_t state;
+ ngx_uint_t state;
u_char *uri_start;
u_char *uri_end;
u_char *uri_ext;