Commit 63056b33 authored by William A. Rowe Jr's avatar William A. Rowe Jr
Browse files

mod_proxy: save DNS lookups

Backports: r1462269, r1463455
Submitted by: rpluem
Reviewed by: wrowe, ylavic



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@1750843 13f79535-47bb-0310-9956-ffa450edef68
parent 88b9a1fa
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -112,13 +112,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
         http://people.apache.org/~rpluem/patches/proxy_race_retry_2.2.x_v2.diff
      +1: rpluem, wrowe, ylavic

  *) mod_proxy: save DNS lookups
      trunk patch: https://svn.apache.org/viewvc?view=revision&revision=1462269
                   https://svn.apache.org/viewvc?view=revision&revision=1463455
      2.4.x patch: http://svn.apache.org/viewvc?view=revision&revision=1511313
      2.2.x patch: http://people.apache.org/~rpluem/patches/proxy-dns-patch_2.2.x.diff
      +1: rpluem, wrowe, ylavic


PATCHES PROPOSED TO BACKPORT FROM TRUNK:
  [ New proposals should be added at the end of the list ]
+38 −26
Original line number Diff line number Diff line
@@ -2233,12 +2233,23 @@ ap_proxy_determine_connection(apr_pool_t *p, request_rec *r,
            conn->port = uri->port;
        }
        socket_cleanup(conn);
        if (!worker->is_address_reusable || worker->disablereuse) {
            /*
             * Only do a lookup if we should not reuse the backend address.
             * Otherwise we will look it up once for the worker.
             */
            err = apr_sockaddr_info_get(&(conn->addr),
                                        conn->hostname, APR_UNSPEC,
                                        conn->port, 0,
                                        conn->pool);
        }
    else if (!worker->cp->addr) {
    }
    if (worker->is_address_reusable && !worker->disablereuse) {
        /*
         * Looking up the backend address for the worker only makes sense if
         * we can reuse the address.
         */
        if (!worker->cp->addr) {
            if ((err = PROXY_THREAD_LOCK(worker)) != APR_SUCCESS) {
                ap_log_error(APLOG_MARK, APLOG_ERR, err, r->server,
                             "proxy: lock");
@@ -2264,6 +2275,7 @@ ap_proxy_determine_connection(apr_pool_t *p, request_rec *r,
        else {
            conn->addr = worker->cp->addr;
        }
    }
    /* Close a possible existing socket if we are told to do so */
    if (conn->close) {
        socket_cleanup(conn);