]> granicus.if.org Git - apache/commitdiff
Eliminate creation of a temporary table in ap_get_mime_headers_core()
authorBrian Pane <brianp@apache.org>
Sun, 22 Jun 2003 22:08:53 +0000 (22:08 +0000)
committerBrian Pane <brianp@apache.org>
Sun, 22 Jun 2003 22:08:53 +0000 (22:08 +0000)
Submitted by: Joe Schaefer <joe+gmane@sunstarsys.com>
Reviewed by: Brian Pane

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100334 13f79535-47bb-0310-9956-ffa450edef68

server/protocol.c

index 22d044e26a61058bf435113a0fecca7d5e29084a..b1f31bbdd65ad90a4ae836669048654d28693ded 100644 (file)
@@ -705,10 +705,6 @@ AP_DECLARE(void) ap_get_mime_headers_core(request_rec *r, apr_bucket_brigade *bb
     char *value;
     apr_size_t len;
     int fields_read = 0;
-    apr_table_t *tmp_headers;
-
-    /* We'll use apr_table_overlap later to merge these into r->headers_in. */
-    tmp_headers = apr_table_make(r->pool, 50);
 
     /*
      * Read header lines until we get the empty separator line, a read error,
@@ -796,7 +792,7 @@ AP_DECLARE(void) ap_get_mime_headers_core(request_rec *r, apr_bucket_brigade *bb
                     ++value;            /* Skip to start of value   */
                 }
 
-                apr_table_addn(tmp_headers, last_field, value);
+                apr_table_addn(r->headers_in, last_field, value);
 
                 /* reset the alloc_len so that we'll allocate a new
                  * buffer if we have to do any more folding: we can't
@@ -823,7 +819,7 @@ AP_DECLARE(void) ap_get_mime_headers_core(request_rec *r, apr_bucket_brigade *bb
         }
     }
 
-    apr_table_overlap(r->headers_in, tmp_headers, APR_OVERLAP_TABLES_MERGE);
+    apr_table_compress(r->headers_in, APR_OVERLAP_TABLES_MERGE);
 }
 
 AP_DECLARE(void) ap_get_mime_headers(request_rec *r)