From 2cd262da3c8b889d034d458b0e4700dc75c8e5b5 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sun, 12 May 2002 01:18:28 +0000 Subject: [PATCH] Optimization: replaced apr_pstrcat+apr_strlen with apr_pstrcatv in basic_http_header() git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95042 13f79535-47bb-0310-9956-ffa450edef68 --- modules/http/http_protocol.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/http/http_protocol.c b/modules/http/http_protocol.c index d54a93d7fc..cd56ea46cc 100644 --- a/modules/http/http_protocol.c +++ b/modules/http/http_protocol.c @@ -1066,6 +1066,7 @@ static void basic_http_header(request_rec *r, apr_bucket_brigade *bb, const char *server; header_struct h; apr_size_t len; + struct iovec vec[4]; if (r->assbackwards) { /* there are no headers to send */ @@ -1074,8 +1075,15 @@ static void basic_http_header(request_rec *r, apr_bucket_brigade *bb, /* Output the HTTP/1.x Status-Line and the Date and Server fields */ - tmp = apr_pstrcat(r->pool, protocol, " ", r->status_line, CRLF, NULL); - len = strlen(tmp); + vec[0].iov_base = (void *)protocol; + vec[0].iov_len = strlen(protocol); + vec[1].iov_base = (void *)" "; + vec[1].iov_len = sizeof(" ") - 1; + vec[2].iov_base = (void *)(r->status_line); + vec[2].iov_len = strlen(r->status_line); + vec[3].iov_base = (void *)CRLF; + vec[3].iov_len = sizeof(CRLF) - 1; + tmp = apr_pstrcatv(r->pool, vec, 4, &len); ap_xlate_proto_to_ascii(tmp, len); apr_brigade_write(bb, NULL, NULL, tmp, len); -- 2.40.0