Commit 093076ed authored by Jeff Trawick's avatar Jeff Trawick
Browse files

mod_proxy: Respect errors reported by pre_connection hooks.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@111304 13f79535-47bb-0310-9956-ffa450edef68
parent 2ee3258c
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2,6 +2,9 @@ Changes with Apache 2.1.2-dev
  [Remove entries to the current 2.0 section below, when backported]
  *) mod_proxy: Respect errors reported by pre_connection hooks.
     [Jeff Trawick]
  *) worker MPM: Fix a problem which could cause httpd processes to
     remain active after shutdown.  [Jeff Trawick]
+9 −1
Original line number Diff line number Diff line
@@ -1725,7 +1725,15 @@ static int proxy_ftp_handler(request_rec *r, proxy_worker *worker,
    }

    /* set up the connection filters */
    ap_run_pre_connection(data, data_sock);
    rc = ap_run_pre_connection(data, data_sock);
    if (rc != OK && rc != DONE) {
        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
                     "proxy: FTP: pre_connection setup failed (%d)",
                     rc);
        data->aborted = 1;
        proxy_ftp_cleanup(r, backend);
        return rc;
    }

    /*
     * VI: Receive the Response ------------------------
+9 −1
Original line number Diff line number Diff line
@@ -1819,6 +1819,7 @@ PROXY_DECLARE(int) ap_proxy_connection_create(const char *proxy_function,
                                              server_rec *s)
{
    apr_sockaddr_t *backend_addr = conn->addr;
    int rc;

    /* The socket is now open, create a new backend server connection 
    * 
@@ -1867,7 +1868,14 @@ PROXY_DECLARE(int) ap_proxy_connection_create(const char *proxy_function,
                 proxy_function, backend_addr, conn->hostname);

    /* set up the connection filters */
    ap_run_pre_connection(conn->connection, conn->sock);
    rc = ap_run_pre_connection(conn->connection, conn->sock);
    if (rc != OK && rc != DONE) {
        conn->connection->aborted = 1;
        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
                     "proxy: %s: pre_connection setup failed (%d)",
                     proxy_function, rc);
        return rc;
    }

    return OK;
}