Commit 47f3cb99 authored by Brian Pane's avatar Brian Pane
Browse files

Optimization: Replaced apr_strcat() with apr_strcatv() in

ap_make_content_type()


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95041 13f79535-47bb-0310-9956-ffa450edef68
parent d874c6a2
Loading
Loading
Loading
Loading
+8 −2
Changes for server/protocol.c: 8 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -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;
            }
        }