From 3cf16ad4c72d4d8d0c6b113019b51f6041b68d3d Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sun, 12 May 2002 00:57:33 +0000 Subject: [PATCH] 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 --- server/protocol.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/server/protocol.c b/server/protocol.c index 73f396afc4..ae8f0c3b06 100644 --- a/server/protocol.c +++ b/server/protocol.c @@ -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; } } -- 2.50.1