From: Christophe Jaillet Date: Thu, 18 Sep 2014 19:06:52 +0000 (+0000) Subject: Concat string at compile time when possible. X-Git-Tag: 2.5.0-alpha~3838 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a9c4c3a37d0e4fcf50048d9e5cbdea2eb6aa996d;p=apache Concat string at compile time when possible. Doing so, sometimes also give the opportunity to turn a 'ap_fputstrs' into a 'ap_fputs'. PR 53741 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1626050 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/arch/netware/mod_nw_ssl.c b/modules/arch/netware/mod_nw_ssl.c index cf535d33e2..d34430023e 100644 --- a/modules/arch/netware/mod_nw_ssl.c +++ b/modules/arch/netware/mod_nw_ssl.c @@ -1192,8 +1192,8 @@ static apr_status_t ssl_io_filter_Upgrade(ap_filter_t *f, /* Send the interim 101 response. */ upgradebb = apr_brigade_create(r->pool, f->c->bucket_alloc); - ap_fputstrs(f->next, upgradebb, SWITCH_STATUS_LINE, CRLF, - UPGRADE_HEADER, CRLF, CONNECTION_HEADER, CRLF, CRLF, NULL); + ap_fputs(f->next, upgradebb, SWITCH_STATUS_LINE CRLF + UPGRADE_HEADER CRLF CONNECTION_HEADER CRLF CRLF); b = apr_bucket_flush_create(f->c->bucket_alloc); APR_BRIGADE_INSERT_TAIL(upgradebb, b); diff --git a/modules/http/http_filters.c b/modules/http/http_filters.c index 1b5b06e18a..7490748d9a 100644 --- a/modules/http/http_filters.c +++ b/modules/http/http_filters.c @@ -367,7 +367,7 @@ apr_status_t ap_http_filter(ap_filter_t *f, apr_bucket_brigade *b, * in a state of expecting one. */ f->r->expecting_100 = 0; - tmp = apr_pstrcat(f->r->pool, AP_SERVER_PROTOCOL, " ", + tmp = apr_pstrcat(f->r->pool, AP_SERVER_PROTOCOL " ", ap_get_status_line(HTTP_CONTINUE), CRLF CRLF, NULL); len = strlen(tmp); ap_xlate_proto_to_ascii(tmp, len); diff --git a/modules/mappers/mod_dir.c b/modules/mappers/mod_dir.c index b076937e85..d2d075d98b 100644 --- a/modules/mappers/mod_dir.c +++ b/modules/mappers/mod_dir.c @@ -262,7 +262,7 @@ static int fixup_dir(request_rec *r) if (r->args != NULL) { ifile = apr_pstrcat(r->pool, ap_escape_uri(r->pool, r->uri), - "/", "?", r->args, NULL); + "/?", r->args, NULL); } else { ifile = apr_pstrcat(r->pool, ap_escape_uri(r->pool, r->uri), diff --git a/modules/proxy/mod_proxy_balancer.c b/modules/proxy/mod_proxy_balancer.c index acfd3861de..f33aa936d5 100644 --- a/modules/proxy/mod_proxy_balancer.c +++ b/modules/proxy/mod_proxy_balancer.c @@ -98,7 +98,7 @@ static int proxy_balancer_canon(request_rec *r, char *url) if (path == NULL) return HTTP_BAD_REQUEST; - r->filename = apr_pstrcat(r->pool, "proxy:", BALANCER_PREFIX, host, + r->filename = apr_pstrcat(r->pool, "proxy:" BALANCER_PREFIX, host, "/", path, (search) ? "?" : "", (search) ? search : "", NULL); r->path_info = apr_pstrcat(r->pool, "/", path, NULL); diff --git a/modules/ssl/ssl_engine_kernel.c b/modules/ssl/ssl_engine_kernel.c index a14e6afe3e..3c255708de 100644 --- a/modules/ssl/ssl_engine_kernel.c +++ b/modules/ssl/ssl_engine_kernel.c @@ -55,8 +55,8 @@ static apr_status_t upgrade_connection(request_rec *r) bb = apr_brigade_create(r->pool, conn->bucket_alloc); - rv = ap_fputstrs(conn->output_filters, bb, SWITCH_STATUS_LINE, CRLF, - UPGRADE_HEADER, CRLF, CONNECTION_HEADER, CRLF, CRLF, NULL); + rv = ap_fputs(conn->output_filters, bb, SWITCH_STATUS_LINE CRLF + UPGRADE_HEADER CRLF CONNECTION_HEADER CRLF CRLF); if (rv == APR_SUCCESS) { APR_BRIGADE_INSERT_TAIL(bb, apr_bucket_flush_create(conn->bucket_alloc));