nginx-0.0.10-2004-09-06-22:45:00 import
diff --git a/src/http/modules/ngx_http_gzip_filter.c b/src/http/modules/ngx_http_gzip_filter.c
index 8fbf3a9..b170df8 100644
--- a/src/http/modules/ngx_http_gzip_filter.c
+++ b/src/http/modules/ngx_http_gzip_filter.c
@@ -297,7 +297,7 @@
                         sizeof(ngx_http_gzip_ctx_t), NGX_ERROR);
     ctx->request = r;
 
-    r->headers_out.content_encoding = ngx_push_list(&r->headers_out.headers);
+    r->headers_out.content_encoding = ngx_list_push(&r->headers_out.headers);
     if (r->headers_out.content_encoding == NULL) {
         return NGX_ERROR;
     }
diff --git a/src/http/modules/ngx_http_headers_filter.c b/src/http/modules/ngx_http_headers_filter.c
index b821c0d..00c0070 100644
--- a/src/http/modules/ngx_http_headers_filter.c
+++ b/src/http/modules/ngx_http_headers_filter.c
@@ -75,13 +75,13 @@
 
     if (conf->expires != NGX_HTTP_EXPIRES_OFF) {
 
-        if (!(expires = ngx_push_list(&r->headers_out.headers))) {
+        if (!(expires = ngx_list_push(&r->headers_out.headers))) {
             return NGX_ERROR;
         }
 
         r->headers_out.expires = expires;
 
-        if (!(cc = ngx_push_list(&r->headers_out.headers))) {
+        if (!(cc = ngx_list_push(&r->headers_out.headers))) {
             return NGX_ERROR;
         }
 
diff --git a/src/http/modules/ngx_http_range_filter.c b/src/http/modules/ngx_http_range_filter.c
index 913c90a..ce13766 100644
--- a/src/http/modules/ngx_http_range_filter.c
+++ b/src/http/modules/ngx_http_range_filter.c
@@ -123,7 +123,7 @@
         || ngx_strncasecmp(r->headers_in.range->value.data, "bytes=", 6) != 0)
     {
 
-        r->headers_out.accept_ranges = ngx_push_list(&r->headers_out.headers);
+        r->headers_out.accept_ranges = ngx_list_push(&r->headers_out.headers);
         if (r->headers_out.accept_ranges == NULL) {
             return NGX_ERROR;
         }
@@ -244,7 +244,7 @@
         r->headers_out.status = rc;
         r->headers_out.ranges.nelts = 0;
 
-        r->headers_out.content_range = ngx_push_list(&r->headers_out.headers);
+        r->headers_out.content_range = ngx_list_push(&r->headers_out.headers);
         if (r->headers_out.content_range == NULL) {
             return NGX_ERROR;
         }
@@ -277,7 +277,7 @@
         if (r->headers_out.ranges.nelts == 1) {
 
             r->headers_out.content_range =
-                                        ngx_push_list(&r->headers_out.headers);
+                                        ngx_list_push(&r->headers_out.headers);
             if (r->headers_out.content_range == NULL) {
                 return NGX_ERROR;
             }
diff --git a/src/http/modules/ngx_http_static_handler.c b/src/http/modules/ngx_http_static_handler.c
index ad7d9cf..5d27cca 100644
--- a/src/http/modules/ngx_http_static_handler.c
+++ b/src/http/modules/ngx_http_static_handler.c
@@ -341,8 +341,8 @@
         *last++ = '/';
         *last = '\0';
 
-        if (!(r->headers_out.location = ngx_push_list(&r->headers_out.headers)))
-        {
+        r->headers_out.location = ngx_list_push(&r->headers_out.headers);
+        if (r->headers_out.location == NULL) {
             return NGX_HTTP_INTERNAL_SERVER_ERROR;
         }
 
diff --git a/src/http/modules/ngx_http_status_handler.c b/src/http/modules/ngx_http_status_handler.c
index 97492eb..6fc1e77 100644
--- a/src/http/modules/ngx_http_status_handler.c
+++ b/src/http/modules/ngx_http_status_handler.c
@@ -70,8 +70,8 @@
         return rc;
     }
 
-    if (!(r->headers_out.content_type = ngx_push_list(&r->headers_out.headers)))
-    {
+    r->headers_out.content_type = ngx_list_push(&r->headers_out.headers);
+    if (r->headers_out.content_type == NULL) {
         return NGX_HTTP_INTERNAL_SERVER_ERROR;
     } 
 
diff --git a/src/http/modules/ngx_http_userid_filter.c b/src/http/modules/ngx_http_userid_filter.c
index 842719e..718cca7 100644
--- a/src/http/modules/ngx_http_userid_filter.c
+++ b/src/http/modules/ngx_http_userid_filter.c
@@ -381,7 +381,7 @@
     ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
                    "uid cookie: \"%s\"", cookie);
 
-    if (!(set_cookie = ngx_push_list(&r->headers_out.headers))) {
+    if (!(set_cookie = ngx_list_push(&r->headers_out.headers))) {
         return NGX_ERROR;
     }
 
diff --git a/src/http/modules/proxy/ngx_http_proxy_handler.h b/src/http/modules/proxy/ngx_http_proxy_handler.h
index fa86982..6e37258 100644
--- a/src/http/modules/proxy/ngx_http_proxy_handler.h
+++ b/src/http/modules/proxy/ngx_http_proxy_handler.h
@@ -107,7 +107,10 @@
 
 
 typedef struct {
+    ngx_list_t                       headers;
+#if 0
     ngx_table_t                      headers;   /* it must be first field */
+#endif
 
     ngx_table_elt_t                 *date;
     ngx_table_elt_t                 *server;
diff --git a/src/http/modules/proxy/ngx_http_proxy_header.c b/src/http/modules/proxy/ngx_http_proxy_header.c
index a3e05e5..9e72f62 100644
--- a/src/http/modules/proxy/ngx_http_proxy_header.c
+++ b/src/http/modules/proxy/ngx_http_proxy_header.c
@@ -12,13 +12,31 @@
                                ngx_http_proxy_headers_in_t *headers_in)
 {
     ngx_uint_t           i;
+    ngx_list_part_t     *part;
     ngx_table_elt_t     *ho, *h;
     ngx_http_request_t  *r;
 
     r = p->request;
 
+    part = &headers_in->headers.part;
+    h = part->elts;
+
+#if 0
     h = headers_in->headers.elts;
     for (i = 0; i < headers_in->headers.nelts; i++) {
+#endif
+
+    for (i = 0 ; /* void */; i++) {
+  
+        if (i >= part->nelts) {
+            if (part->next == NULL) {
+                break;
+            }
+  
+            part = part->next;
+            h = part->elts;
+            i = 0;
+        }
 
         /* ignore some headers */
 
@@ -69,8 +87,7 @@
 
         /* copy some header pointers and set up r->headers_out */
 
-        if (!(ho = ngx_http_add_header(&r->headers_out, ngx_http_headers_out)))
-        {
+        if (!(ho = ngx_list_push(&r->headers_out.headers))) {
             return NGX_ERROR;
         }
 
@@ -138,8 +155,7 @@
     r = p->request;
     uc = p->lcf->upstream;
 
-    location = ngx_http_add_header(&r->headers_out, ngx_http_headers_out);
-    if (location == NULL) {
+    if (!(location = ngx_list_push(&r->headers_out.headers))) {
         return NGX_ERROR;
     }
 
diff --git a/src/http/modules/proxy/ngx_http_proxy_upstream.c b/src/http/modules/proxy/ngx_http_proxy_upstream.c
index 5930ceb..0cffbce 100644
--- a/src/http/modules/proxy/ngx_http_proxy_upstream.c
+++ b/src/http/modules/proxy/ngx_http_proxy_upstream.c
@@ -954,20 +954,22 @@
 
     /* init or reinit the p->upstream->headers_in.headers table */
 
-    if (p->upstream->headers_in.headers.elts) {
-        p->upstream->headers_in.headers.nelts = 0;
+    if (p->upstream->headers_in.headers.part.elts) {
+        p->upstream->headers_in.headers.part.nelts = 0;
+        p->upstream->headers_in.headers.part.next = NULL;
+        p->upstream->headers_in.headers.last =
+                                         &p->upstream->headers_in.headers.part;
+
+        ngx_memzero(&p->upstream->headers_in.date,
+                    sizeof(ngx_http_proxy_headers_in_t) - sizeof(ngx_list_t));
 
     } else {
-        p->upstream->headers_in.headers.elts = ngx_pcalloc(p->request->pool,
-                                                 20 * sizeof(ngx_table_elt_t));
-        if (p->upstream->headers_in.headers.elts == NULL) {
+        if (ngx_list_init(&p->upstream->headers_in.headers, p->request->pool,
+                                     20, sizeof(ngx_table_elt_t)) == NGX_ERROR)
+        {
             ngx_http_proxy_finalize_request(p, NGX_HTTP_INTERNAL_SERVER_ERROR);
             return;
         }
-        /* p->upstream->headers_in.headers.nelts = 0; */
-        p->upstream->headers_in.headers.nalloc = 20;
-        p->upstream->headers_in.headers.size = sizeof(ngx_table_elt_t);
-        p->upstream->headers_in.headers.pool = p->request->pool;
     }
 
 
@@ -1025,9 +1027,7 @@
 
             /* a header line has been parsed successfully */
 
-            h = ngx_http_add_header(&p->upstream->headers_in,
-                                    ngx_http_proxy_headers_in);
-            if (h == NULL) {
+            if (!(h = ngx_list_push(&p->upstream->headers_in.headers))) {
                 ngx_http_proxy_finalize_request(p,
                                                 NGX_HTTP_INTERNAL_SERVER_ERROR);
                 return;