uri->fragment ? "#" : "",
uri->fragment ? uri->fragment : "", NULL);
}
-
+
+ /* TODO: add address cache for forward proxies */
+ conn->addr = worker->cp->addr;
if (r->proxyreq == PROXYREQ_PROXY) {
- err = apr_sockaddr_info_get(&(worker->cp->addr),
+ err = apr_sockaddr_info_get(&(conn->addr),
conn->hostname, APR_UNSPEC,
conn->port, 0,
p);
}
- else if (!worker->cp->addr)
+ else if (!worker->cp->addr) {
/* Worker can have the single constant backend adress.
* The single DNS lookup is used once per worker.
* If dynamic change is needed then set the addr to NULL
conn->hostname, APR_UNSPEC,
conn->port, 0,
worker->cp->pool);
-
+ conn->addr = worker->cp->addr;
+ }
if (err != APR_SUCCESS) {
return ap_proxyerror(r, HTTP_BAD_GATEWAY,
apr_pstrcat(p, "DNS lookup failure for: ",
}
/* check if ProxyBlock directive on this host */
- if (OK != ap_proxy_checkproxyblock(r, conf, worker->cp->addr)) {
+ if (OK != ap_proxy_checkproxyblock(r, conf, conn->addr)) {
return ap_proxyerror(r, HTTP_FORBIDDEN,
"Connect to remote machine blocked");
}
apr_status_t rv;
int connected = 0;
int loglevel;
- apr_sockaddr_t *backend_addr = worker->cp->addr;
+ apr_sockaddr_t *backend_addr = conn->addr;
apr_socket_t *newsock;
if (conn->sock) {
server_rec *s)
{
proxy_worker *worker = conn->worker;
- apr_sockaddr_t *backend_addr = worker->cp->addr;
+ apr_sockaddr_t *backend_addr = conn->addr;
/* The socket is now open, create a new backend server connection
*