nginx-0.0.3-2004-03-16-16:35:20 import
diff --git a/src/http/modules/proxy/ngx_http_proxy_handler.c b/src/http/modules/proxy/ngx_http_proxy_handler.c
index d36867d..61fea1c 100644
--- a/src/http/modules/proxy/ngx_http_proxy_handler.c
+++ b/src/http/modules/proxy/ngx_http_proxy_handler.c
@@ -984,7 +984,7 @@
                           NGX_CONF_ERROR);
 
             len = ngx_inet_ntop(AF_INET,
-                                (u_char *) &lcf->peers->peers[i].addr,
+                                &lcf->peers->peers[i].addr,
                                 lcf->peers->peers[i].addr_port_text.data,
                                 len);
 
diff --git a/src/http/modules/proxy/ngx_http_proxy_upstream.c b/src/http/modules/proxy/ngx_http_proxy_upstream.c
index 7704cb1..a4b6fda 100644
--- a/src/http/modules/proxy/ngx_http_proxy_upstream.c
+++ b/src/http/modules/proxy/ngx_http_proxy_upstream.c
@@ -303,8 +303,8 @@
 
     ngx_chain_t               *cl;
     ngx_http_request_t        *r;
-    ngx_output_chain_ctx_t    *octx;
-    ngx_chain_writer_ctx_t    *wctx;
+    ngx_output_chain_ctx_t    *output;
+    ngx_chain_writer_ctx_t    *writer;
     ngx_http_proxy_log_ctx_t  *lctx;
 
     r = p->request;
@@ -359,27 +359,27 @@
     r->connection->log->handler = ngx_http_proxy_log_error;
     p->action = "connecting to upstream";
 
-    if (!(octx = ngx_pcalloc(r->pool, sizeof(ngx_output_chain_ctx_t)))) {
+    if (!(output = ngx_pcalloc(r->pool, sizeof(ngx_output_chain_ctx_t)))) {
         ngx_http_proxy_finalize_request(p, NGX_HTTP_INTERNAL_SERVER_ERROR);
         return;
     }
 
-    p->upstream->output_chain_ctx = octx;
+    p->upstream->output_chain_ctx = output;
 
-    octx->sendfile = r->sendfile;
-    octx->pool = r->pool;
-    octx->bufs.num = 1;
-    octx->tag = (ngx_hunk_tag_t) &ngx_http_proxy_module;
-    octx->output_filter = (ngx_output_chain_filter_pt) ngx_chain_writer;
+    output->sendfile = r->sendfile;
+    output->pool = r->pool;
+    output->bufs.num = 1;
+    output->tag = (ngx_hunk_tag_t) &ngx_http_proxy_module;
+    output->output_filter = (ngx_output_chain_filter_pt) ngx_chain_writer;
 
-    if (!(wctx = ngx_palloc(r->pool, sizeof(ngx_chain_writer_ctx_t)))) {
+    if (!(writer = ngx_palloc(r->pool, sizeof(ngx_chain_writer_ctx_t)))) {
         ngx_http_proxy_finalize_request(p, NGX_HTTP_INTERNAL_SERVER_ERROR);
         return;
     }
 
-    octx->output_ctx = wctx;
+    output->output_ctx = writer;
 
-    wctx->pool = r->pool;
+    writer->pool = r->pool;
 
     if (p->lcf->busy_lock && !p->busy_locked) {
         ngx_http_proxy_upstream_busy_lock(p);
@@ -392,9 +392,9 @@
 static void ngx_http_proxy_reinit_upstream(ngx_http_proxy_ctx_t *p)
 {
     ngx_chain_t             *cl;
-    ngx_output_chain_ctx_t  *octx;
+    ngx_output_chain_ctx_t  *output;
 
-    octx = p->upstream->output_chain_ctx;
+    output = p->upstream->output_chain_ctx;
 
     /* reinit the request chain */
 
@@ -404,10 +404,10 @@
 
     /* reinit ngx_output_chain() context */
 
-    octx->hunk = NULL;
-    octx->in = NULL;
-    octx->free = NULL;
-    octx->busy = NULL;
+    output->hunk = NULL;
+    output->in = NULL;
+    output->free = NULL;
+    output->busy = NULL;
 
     /* reinit r->header_in buffer */
 
@@ -487,7 +487,7 @@
     int                      rc;
     ngx_connection_t        *c;
     ngx_http_request_t      *r;
-    ngx_output_chain_ctx_t  *octx;
+    ngx_output_chain_ctx_t  *output;
 
     p->action = "connecting to upstream";
 
@@ -517,7 +517,7 @@
     c->pool = r->pool;
     c->read->log = c->write->log = c->log = r->connection->log;
 
-    octx = p->upstream->output_chain_ctx;
+    output = p->upstream->output_chain_ctx;
 
     if (p->upstream->peer.tries > 1 && p->request_sent) {
         ngx_http_proxy_reinit_upstream(p);
@@ -526,14 +526,14 @@
     /* init or reinit ngx_output_chain() context */
 
     if (r->request_body_hunk) {
-        if (!(octx->free = ngx_alloc_chain_link(r->pool))) {
+        if (!(output->free = ngx_alloc_chain_link(r->pool))) {
             ngx_http_proxy_finalize_request(p, NGX_HTTP_INTERNAL_SERVER_ERROR);
             return;
         }
 
-        octx->free->hunk = r->request_body_hunk;
-        octx->free->next = NULL;
-        octx->hunks = 1;
+        output->free->hunk = r->request_body_hunk;
+        output->free->next = NULL;
+        output->hunks = 1;
 
         r->request_body_hunk->pos = r->request_body_hunk->start;
         r->request_body_hunk->last = r->request_body_hunk->start;
@@ -565,7 +565,7 @@
 {
     int                      rc;
     ngx_connection_t        *c;
-    ngx_chain_writer_ctx_t  *wctx;
+    ngx_chain_writer_ctx_t  *writer;
 
     c = p->upstream->peer.connection;
 
@@ -586,10 +586,10 @@
 
     p->action = "sending request to upstream";
 
-    wctx = p->upstream->output_chain_ctx->output_ctx;
-    wctx->out = NULL;
-    wctx->last = &wctx->out;
-    wctx->connection = c;
+    writer = p->upstream->output_chain_ctx->output_ctx;
+    writer->out = NULL;
+    writer->last = &writer->out;
+    writer->connection = c;
 
     rc = ngx_output_chain(p->upstream->output_chain_ctx,
                           p->request_sent ? NULL : p->request->request_hunks);
diff --git a/src/http/ngx_http.c b/src/http/ngx_http.c
index 9d53d88..4ddca78 100644
--- a/src/http/ngx_http.c
+++ b/src/http/ngx_http.c
@@ -496,8 +496,7 @@
             ls->addr_text.len =
                         ngx_snprintf((char *) ls->addr_text.data
                                      + ngx_inet_ntop(AF_INET,
-                                                     (u_char *)
-                                                               &in_addr[a].addr,
+                                                     &in_addr[a].addr,
                                                      ls->addr_text.data,
                                                      INET_ADDRSTRLEN),
                                      6, ":%d", in_port[p].port);
@@ -597,7 +596,7 @@
         in_addr = in_port[p].addrs.elts;
         for (a = 0; a < in_port[p].addrs.nelts; a++) {
             u_char ip[20];
-            ngx_inet_ntop(AF_INET, (u_char *) &in_addr[a].addr, ip, 20);
+            ngx_inet_ntop(AF_INET, &in_addr[a].addr, ip, 20);
             ngx_log_debug2(NGX_LOG_DEBUG_HTTP, cf->log, 0,
                            "%s %08x", ip, in_addr[a].core_srv_conf);
             s_name = in_addr[a].names.elts;
diff --git a/src/http/ngx_http_parse.c b/src/http/ngx_http_parse.c
index c860245..e1304e8 100644
--- a/src/http/ngx_http_parse.c
+++ b/src/http/ngx_http_parse.c
@@ -458,7 +458,7 @@
                 state = sw_name;
                 r->header_name_start = p - 1;
 
-                c = (char) (ch | 0x20);
+                c = (u_char) (ch | 0x20);
                 if (c >= 'a' && c <= 'z') {
                     break;
                 }
@@ -778,15 +778,15 @@
 
         case sw_quoted:
             if (ch >= '0' && ch <= '9') {
-                decoded = (char) (ch - '0');
+                decoded = (u_char) (ch - '0');
                 state = sw_quoted_second;
                 ch = *p++;
                 break;
             }
 
-            c = (char) (ch | 0x20);
+            c = (u_char) (ch | 0x20);
             if (c >= 'a' && c <= 'f') {
-                decoded = (char) (c - 'a' + 10);
+                decoded = (u_char) (c - 'a' + 10);
                 state = sw_quoted_second;
                 ch = *p++;
                 break;
@@ -796,7 +796,7 @@
 
         case sw_quoted_second:
             if (ch >= '0' && ch <= '9') {
-                ch = (char) ((decoded << 4) + ch - '0');
+                ch = (u_char) ((decoded << 4) + ch - '0');
                 if (ch == '%') {
                     state = sw_usual;
                     *u++ = ch;
@@ -807,9 +807,9 @@
                 break;
             }
 
-            c = (char) (ch | 0x20);
+            c = (u_char) (ch | 0x20);
             if (c >= 'a' && c <= 'f') {
-                ch = (char) ((decoded << 4) + c - 'a' + 10);
+                ch = (u_char) ((decoded << 4) + c - 'a' + 10);
                 if (ch == '%') {
                     state = sw_usual;
                     *u++ = ch;
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index 4113279..b69e790 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -64,6 +64,7 @@
     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;