You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ja...@apache.org on 2017/01/06 11:52:15 UTC

svn commit: r1777593 - /httpd/httpd/trunk/server/vhost.c

Author: jailletc36
Date: Fri Jan  6 11:52:15 2017
New Revision: 1777593

URL: http://svn.apache.org/viewvc?rev=1777593&view=rev
Log:
'repl' is already allocated in the request pool by 'construct_host_header()' the line just before.
So this is safe to use the 'apr_table_setn' variant in order to save a few bytes of memory.

Modified:
    httpd/httpd/trunk/server/vhost.c

Modified: httpd/httpd/trunk/server/vhost.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/vhost.c?rev=1777593&r1=1777592&r2=1777593&view=diff
==============================================================================
--- httpd/httpd/trunk/server/vhost.c (original)
+++ httpd/httpd/trunk/server/vhost.c Fri Jan  6 11:52:15 2017
@@ -1163,7 +1163,7 @@ AP_DECLARE(void) ap_update_vhost_from_he
          */
         if (have_hostname_from_url && host_header != NULL) {
             const char *repl = construct_host_header(r, is_v6literal);
-            apr_table_set(r->headers_in, "Host", repl);
+            apr_table_setn(r->headers_in, "Host", repl);
             ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(02417)
                           "Replacing host header '%s' with host '%s' given "
                           "in the request uri", host_header, repl);