Loading modules/proxy/proxy_util.c +16 −19 Original line number Diff line number Diff line Loading @@ -1610,8 +1610,6 @@ ap_proxy_determine_connection(apr_pool_t *p, request_rec *r, { int server_port; apr_status_t err = APR_SUCCESS; const char *hostname; apr_port_t port; /* * Break up the URL to determine the host to connect to Loading Loading @@ -1642,34 +1640,30 @@ ap_proxy_determine_connection(apr_pool_t *p, request_rec *r, uri->fragment ? "#" : "", uri->fragment ? uri->fragment : "", NULL); } if (!conn->hostname) { if (!worker->is_address_reusable) { if (proxyname) { conn->hostname = apr_pstrdup(conn->pool, proxyname); conn->hostname = proxyname; conn->port = proxyport; } else { conn->hostname = apr_pstrdup(conn->pool, uri->hostname); conn->hostname = uri->hostname; conn->port = uri->port; } } if (!worker->is_address_reusable) { else if (!conn->hostname) { if (proxyname) { hostname = proxyname; port = proxyport; conn->hostname = apr_pstrdup(conn->pool, proxyname); conn->port = proxyport; } else { hostname = uri->hostname; port = uri->port; } conn->hostname = apr_pstrdup(conn->pool, uri->hostname); conn->port = uri->port; } else { hostname = conn->hostname; port = conn->port; } /* TODO: add address cache for forward proxies */ if (r->proxyreq == PROXYREQ_PROXY || r->proxyreq == PROXYREQ_REVERSE || !worker->is_address_reusable) { err = apr_sockaddr_info_get(&(conn->addr), hostname, APR_UNSPEC, port, 0, conn->hostname, APR_UNSPEC, conn->port, 0, conn->pool); } else if (!worker->cp->addr) { Loading @@ -1685,8 +1679,8 @@ ap_proxy_determine_connection(apr_pool_t *p, request_rec *r, * inside dynamic config to force the lookup. */ err = apr_sockaddr_info_get(&(worker->cp->addr), hostname, APR_UNSPEC, port, 0, conn->hostname, APR_UNSPEC, conn->port, 0, worker->cp->pool); conn->addr = worker->cp->addr; PROXY_THREAD_UNLOCK(worker); Loading @@ -1694,7 +1688,7 @@ ap_proxy_determine_connection(apr_pool_t *p, request_rec *r, if (err != APR_SUCCESS) { return ap_proxyerror(r, HTTP_BAD_GATEWAY, apr_pstrcat(p, "DNS lookup failure for: ", hostname, NULL)); conn->hostname, NULL)); } /* Get the server port for the Via headers */ Loading @@ -1712,6 +1706,9 @@ ap_proxy_determine_connection(apr_pool_t *p, request_rec *r, return ap_proxyerror(r, HTTP_FORBIDDEN, "Connect to remote machine blocked"); } ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "proxy: connected %s to %s:%d", *url, conn->hostname, conn->port); return OK; } Loading Loading
modules/proxy/proxy_util.c +16 −19 Original line number Diff line number Diff line Loading @@ -1610,8 +1610,6 @@ ap_proxy_determine_connection(apr_pool_t *p, request_rec *r, { int server_port; apr_status_t err = APR_SUCCESS; const char *hostname; apr_port_t port; /* * Break up the URL to determine the host to connect to Loading Loading @@ -1642,34 +1640,30 @@ ap_proxy_determine_connection(apr_pool_t *p, request_rec *r, uri->fragment ? "#" : "", uri->fragment ? uri->fragment : "", NULL); } if (!conn->hostname) { if (!worker->is_address_reusable) { if (proxyname) { conn->hostname = apr_pstrdup(conn->pool, proxyname); conn->hostname = proxyname; conn->port = proxyport; } else { conn->hostname = apr_pstrdup(conn->pool, uri->hostname); conn->hostname = uri->hostname; conn->port = uri->port; } } if (!worker->is_address_reusable) { else if (!conn->hostname) { if (proxyname) { hostname = proxyname; port = proxyport; conn->hostname = apr_pstrdup(conn->pool, proxyname); conn->port = proxyport; } else { hostname = uri->hostname; port = uri->port; } conn->hostname = apr_pstrdup(conn->pool, uri->hostname); conn->port = uri->port; } else { hostname = conn->hostname; port = conn->port; } /* TODO: add address cache for forward proxies */ if (r->proxyreq == PROXYREQ_PROXY || r->proxyreq == PROXYREQ_REVERSE || !worker->is_address_reusable) { err = apr_sockaddr_info_get(&(conn->addr), hostname, APR_UNSPEC, port, 0, conn->hostname, APR_UNSPEC, conn->port, 0, conn->pool); } else if (!worker->cp->addr) { Loading @@ -1685,8 +1679,8 @@ ap_proxy_determine_connection(apr_pool_t *p, request_rec *r, * inside dynamic config to force the lookup. */ err = apr_sockaddr_info_get(&(worker->cp->addr), hostname, APR_UNSPEC, port, 0, conn->hostname, APR_UNSPEC, conn->port, 0, worker->cp->pool); conn->addr = worker->cp->addr; PROXY_THREAD_UNLOCK(worker); Loading @@ -1694,7 +1688,7 @@ ap_proxy_determine_connection(apr_pool_t *p, request_rec *r, if (err != APR_SUCCESS) { return ap_proxyerror(r, HTTP_BAD_GATEWAY, apr_pstrcat(p, "DNS lookup failure for: ", hostname, NULL)); conn->hostname, NULL)); } /* Get the server port for the Via headers */ Loading @@ -1712,6 +1706,9 @@ ap_proxy_determine_connection(apr_pool_t *p, request_rec *r, return ap_proxyerror(r, HTTP_FORBIDDEN, "Connect to remote machine blocked"); } ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "proxy: connected %s to %s:%d", *url, conn->hostname, conn->port); return OK; } Loading