diff options
author | Jim Jagielski <jim@apache.org> | 2013-08-23 18:00:47 +0200 |
---|---|---|
committer | Jim Jagielski <jim@apache.org> | 2013-08-23 18:00:47 +0200 |
commit | 66eaba96f6670d5c8e7a941e311d45dce7725153 (patch) | |
tree | 2e0b88e460f3ee64c7dd8d22111aaefc48598e51 /modules/proxy/proxy_util.c | |
parent | elaborate on the early/late vs "Authorization" header (vs. other forms of (diff) | |
download | apache2-66eaba96f6670d5c8e7a941e311d45dce7725153.tar.xz apache2-66eaba96f6670d5c8e7a941e311d45dce7725153.zip |
Save some cycles...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1516911 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | modules/proxy/proxy_util.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index b33c8d76c3..b7c10709f1 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -40,6 +40,7 @@ APLOG_USE_MODULE(proxy); +#define UDS_SOCKET_STRING "uds=" /* * Opaque structure containing target server info when * using a forward proxy. @@ -2119,7 +2120,7 @@ ap_proxy_determine_connection(apr_pool_t *p, request_rec *r, * spilling the cached addr from the worker. */ if (!conn->hostname || !worker->s->is_address_reusable || - worker->s->disablereuse || strncmp(conn->hostname, "socket=", 7) == 0) { + worker->s->disablereuse || strncmp(conn->hostname, UDS_SOCKET_STRING, sizeof(UDS_SOCKET_STRING)-1) == 0) { if (proxyname) { conn->hostname = apr_pstrdup(conn->pool, proxyname); conn->port = proxyport; @@ -2157,8 +2158,8 @@ ap_proxy_determine_connection(apr_pool_t *p, request_rec *r, conn->port = uri->port; } socket_cleanup(conn); - if (strncmp(conn->hostname, "socket=", 7) == 0) { - char *uds_path = apr_pstrdup(conn->pool, conn->hostname + 7); + if (strncmp(conn->hostname, UDS_SOCKET_STRING, sizeof(UDS_SOCKET_STRING)-1) == 0) { + char *uds_path = apr_pstrdup(conn->pool, conn->hostname + sizeof(UDS_SOCKET_STRING) - 1); decodeenc(uds_path); conn->uds_path = uds_path; } |