]> granicus.if.org Git - apache/commitdiff
Optimization: Replaced apr_strcat() with apr_strcatv() in
authorBrian Pane <brianp@apache.org>
Sun, 12 May 2002 00:57:33 +0000 (00:57 +0000)
committerBrian Pane <brianp@apache.org>
Sun, 12 May 2002 00:57:33 +0000 (00:57 +0000)
ap_make_content_type()

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

server/protocol.c

index 73f396afc49d85232a3788546df51d3c6e9b81d1..ae8f0c3b06a31306aa8f9bb5c8e25c1794b52982 100644 (file)
@@ -169,8 +169,14 @@ AP_DECLARE(const char *)ap_make_content_type(request_rec *r, const char *type)
          */
         for (pcset = needcset_patterns; *pcset ; pcset++) {
             if (apr_strmatch(*pcset, type, type_len) != NULL) {
-                type = apr_pstrcat(r->pool, type, "; charset=",
-                                   conf->add_default_charset_name, NULL);
+                struct iovec concat[3];
+                concat[0].iov_base = (void *)type;
+                concat[0].iov_len = type_len;
+                concat[1].iov_base = (void *)"; charset=";
+                concat[1].iov_len = sizeof("; charset=") - 1;
+                concat[2].iov_base = (void *)(conf->add_default_charset_name);
+                concat[2].iov_len = strlen(conf->add_default_charset_name);
+                type = apr_pstrcatv(r->pool, concat, 3, NULL);
                 break;
             }
         }