Commit 0a49cd36 authored by Joe Orton's avatar Joe Orton
Browse files

* server/mpm_common.c (ap_mpm_pod_open, dummy_connection): Use

ap_listeners->bind_addr for the dummy connection rather than doing a
name lookup on the first listener's hostname and using one of the
addresses returned.

* server/mpm_common.c (dummy_connection): Log the address if the
connect() fails.

Reviewed by: jorton, trawick, stoddard


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.0.x@155213 13f79535-47bb-0310-9956-ffa450edef68
parent cd911883
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -100,14 +100,6 @@ PATCHES TO BACKPORT FROM TRUNK:
       Patch for 2.0: http://www.apache.org/~pquerna/c-i-f-leak.patch
       +1: pquerna, trawick

    *) dummy_connection tweak: directly use the address of the first
       listener rather than extracting through getnameinfo(), and log
       the address for better diagnostics in error cases.
       http://svn.apache.org/viewcvs.cgi?rev=102869&view=rev
       http://svn.apache.org/viewcvs.cgi?rev=105264&view=rev
       rediffed for 2.0 as: http://www.apache.org/~jorton/ap_dummy.diff
       +1: jorton, trawick, stoddard

    *) mod_ssl: Set r->user from SSLUsername earlier so that it's
       actually useful.
       http://svn.apache.org/viewcvs.cgi?rev=153280&view=rev
+3 −6
Original line number Diff line number Diff line
@@ -368,9 +368,6 @@ AP_DECLARE(apr_status_t) ap_mpm_pod_open(apr_pool_t *p, ap_pod_t **pod)
    apr_file_pipe_timeout_set((*pod)->pod_in, 0);
    (*pod)->p = p;

    apr_sockaddr_info_get(&(*pod)->sa, ap_listeners->bind_addr->hostname,
                          APR_UNSPEC, ap_listeners->bind_addr->port, 0, p);

    /* close these before exec. */
    apr_file_unset_inherit((*pod)->pod_in);
    apr_file_unset_inherit((*pod)->pod_out);
@@ -446,7 +443,7 @@ static apr_status_t dummy_connection(ap_pod_t *pod)
        return rv;
    }

    rv = apr_socket_create(&sock, pod->sa->family, SOCK_STREAM, p);
    rv = apr_socket_create(&sock, ap_listeners->bind_addr->family, SOCK_STREAM, p);
    if (rv != APR_SUCCESS) {
        ap_log_error(APLOG_MARK, APLOG_WARNING, rv, ap_server_conf,
                     "get socket to connect to listener");
@@ -467,7 +464,7 @@ static apr_status_t dummy_connection(ap_pod_t *pod)
        return rv;
    }

    rv = apr_connect(sock, pod->sa);
    rv = apr_connect(sock, ap_listeners->bind_addr);
    if (rv != APR_SUCCESS) {
        int log_level = APLOG_WARNING;

@@ -480,7 +477,7 @@ static apr_status_t dummy_connection(ap_pod_t *pod)
        }

        ap_log_error(APLOG_MARK, log_level, rv, ap_server_conf,
                     "connect to listener");
                     "connect to listener on %pI", ap_listeners->bind_addr);
    }

    apr_socket_close(sock);