diff options
Diffstat (limited to 'modules/proxy/proxy_util.c')
-rw-r--r-- | modules/proxy/proxy_util.c | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index 11cbe9187a..59f5e3084d 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -1694,9 +1694,13 @@ PROXY_DECLARE(char *) ap_proxy_define_worker(apr_pool_t *p, ap_log_error(APLOG_MARK, APLOG_ERR, 0, ap_server_conf, APLOGNO(010117) "Alert! worker scheme (%s) too long; truncated to: %s", uri.scheme, wshared->scheme); } + if (PROXY_STRNCPY(wshared->hostname_ex, uri.hostname) != APR_SUCCESS) { + return apr_psprintf(p, "worker hostname (%s) too long", uri.hostname); + } if (PROXY_STRNCPY(wshared->hostname, uri.hostname) != APR_SUCCESS) { - ap_log_error(APLOG_MARK, APLOG_ERR, 0, ap_server_conf, APLOGNO(010118) - "Alert! worker hostname (%s) too long; truncated to: %s", uri.hostname, wshared->hostname); + ap_log_error(APLOG_MARK, APLOG_INFO, 0, ap_server_conf, APLOGNO(010118) + "worker hostname (%s) too long; truncated for legacy modules that do not use " + "proxy_worker_shared->hostname_ex: %s", uri.hostname, wshared->hostname); } wshared->flush_packets = flush_off; wshared->flush_wait = PROXY_FLUSH_WAIT; @@ -1854,7 +1858,7 @@ PROXY_DECLARE(apr_status_t) ap_proxy_initialize_worker(proxy_worker *worker, ser ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(00930) "initialized pool in child %" APR_PID_T_FMT " for (%s) min=%d max=%d smax=%d", - getpid(), worker->s->hostname, worker->s->min, + getpid(), worker->s->hostname_ex, worker->s->min, worker->s->hmax, worker->s->smax); /* Set the acquire timeout */ @@ -1871,7 +1875,7 @@ PROXY_DECLARE(apr_status_t) ap_proxy_initialize_worker(proxy_worker *worker, ser ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(00931) "initialized single connection worker in child %" APR_PID_T_FMT " for (%s)", - getpid(), worker->s->hostname); + getpid(), worker->s->hostname_ex); } apr_global_mutex_unlock(proxy_mutex); @@ -1890,7 +1894,7 @@ static int ap_proxy_retry_worker(const char *proxy_function, proxy_worker *worke if (PROXY_WORKER_IS(worker, PROXY_WORKER_STOPPED)) { ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(3305) "%s: Won't retry worker (%s): stopped", - proxy_function, worker->s->hostname); + proxy_function, worker->s->hostname_ex); return DECLINED; } if ((worker->s->status & PROXY_WORKER_IGNORE_ERRORS) @@ -1899,13 +1903,13 @@ static int ap_proxy_retry_worker(const char *proxy_function, proxy_worker *worke worker->s->status &= ~PROXY_WORKER_IN_ERROR; ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(00932) "%s: worker for (%s) has been marked for retry", - proxy_function, worker->s->hostname); + proxy_function, worker->s->hostname_ex); return OK; } else { ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(00933) "%s: too soon to retry worker for (%s)", - proxy_function, worker->s->hostname); + proxy_function, worker->s->hostname_ex); return DECLINED; } } @@ -2127,7 +2131,7 @@ PROXY_DECLARE(int) ap_proxy_acquire_connection(const char *proxy_function, if (!PROXY_WORKER_IS_USABLE(worker)) { ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, APLOGNO(00940) "%s: disabled connection for (%s)", - proxy_function, worker->s->hostname); + proxy_function, worker->s->hostname_ex); return HTTP_SERVICE_UNAVAILABLE; } } @@ -2150,12 +2154,12 @@ PROXY_DECLARE(int) ap_proxy_acquire_connection(const char *proxy_function, if (rv != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, APLOGNO(00941) "%s: failed to acquire connection for (%s)", - proxy_function, worker->s->hostname); + proxy_function, worker->s->hostname_ex); return HTTP_SERVICE_UNAVAILABLE; } ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(00942) "%s: has acquired connection for (%s)", - proxy_function, worker->s->hostname); + proxy_function, worker->s->hostname_ex); (*conn)->worker = worker; (*conn)->close = 0; @@ -2170,7 +2174,7 @@ PROXY_DECLARE(int) ap_proxy_release_connection(const char *proxy_function, { ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(00943) "%s: has released connection for (%s)", - proxy_function, conn->worker->s->hostname); + proxy_function, conn->worker->s->hostname_ex); connection_cleanup(conn); return OK; @@ -2766,7 +2770,7 @@ PROXY_DECLARE(int) ap_proxy_connect_backend(const char *proxy_function, "%s: error creating Unix domain socket for " "target %s", proxy_function, - worker->s->hostname); + worker->s->hostname_ex); break; } conn->connection = NULL; @@ -2779,7 +2783,7 @@ PROXY_DECLARE(int) ap_proxy_connect_backend(const char *proxy_function, "%s (%s) failed", proxy_function, conn->uds_path, - worker->s->hostname); + worker->s->hostname_ex); break; } @@ -2788,7 +2792,7 @@ PROXY_DECLARE(int) ap_proxy_connect_backend(const char *proxy_function, "%s (%s)", proxy_function, conn->uds_path, - worker->s->hostname); + worker->s->hostname_ex); } else #endif @@ -2802,7 +2806,7 @@ PROXY_DECLARE(int) ap_proxy_connect_backend(const char *proxy_function, "target %s", proxy_function, backend_addr->family, - worker->s->hostname); + worker->s->hostname_ex); /* * this could be an IPv6 address from the DNS but the * local machine won't give us an IPv6 socket; hopefully the @@ -2852,7 +2856,7 @@ PROXY_DECLARE(int) ap_proxy_connect_backend(const char *proxy_function, } ap_log_error(APLOG_MARK, APLOG_TRACE2, 0, s, "%s: fam %d socket created to connect to %s", - proxy_function, backend_addr->family, worker->s->hostname); + proxy_function, backend_addr->family, worker->s->hostname_ex); if (conf->source_address_set) { local_addr = apr_pmemdup(conn->scpool, conf->source_address, @@ -2877,7 +2881,7 @@ PROXY_DECLARE(int) ap_proxy_connect_backend(const char *proxy_function, "%s: attempt to connect to %pI (%s) failed", proxy_function, backend_addr, - worker->s->hostname); + worker->s->hostname_ex); backend_addr = backend_addr->next; continue; } @@ -2886,7 +2890,7 @@ PROXY_DECLARE(int) ap_proxy_connect_backend(const char *proxy_function, "%s: connection established with %pI (%s)", proxy_function, backend_addr, - worker->s->hostname); + worker->s->hostname_ex); } /* Set a timeout on the socket */ @@ -2920,7 +2924,7 @@ PROXY_DECLARE(int) ap_proxy_connect_backend(const char *proxy_function, "via http CONNECT through %pI (%s) failed", proxy_function, forward->target_host, forward->target_port, - backend_addr, worker->s->hostname); + backend_addr, worker->s->hostname_ex); backend_addr = backend_addr->next; continue; } @@ -2942,7 +2946,7 @@ PROXY_DECLARE(int) ap_proxy_connect_backend(const char *proxy_function, ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, APLOGNO(00959) "ap_proxy_connect_backend disabling worker for (%s) for %" APR_TIME_T_FMT "s", - worker->s->hostname, apr_time_sec(worker->s->retry)); + worker->s->hostname_ex, apr_time_sec(worker->s->retry)); } } else { |