From: Brian Pane Date: Sun, 22 Jun 2003 22:08:53 +0000 (+0000) Subject: Eliminate creation of a temporary table in ap_get_mime_headers_core() X-Git-Tag: pre_ajp_proxy~1516 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cb820d48b8be3ea40483b95486e6f3d7405214a3;p=apache Eliminate creation of a temporary table in ap_get_mime_headers_core() Submitted by: Joe Schaefer Reviewed by: Brian Pane git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100334 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/protocol.c b/server/protocol.c index 22d044e26a..b1f31bbdd6 100644 --- a/server/protocol.c +++ b/server/protocol.c @@ -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)