Commit c3f3fbb1 authored by Justin Erenkrantz's avatar Justin Erenkrantz
Browse files

mod_proxy: Respect errors reported by pre_connection hooks.

MFC: 111304 (adjusted by Justin to apply against 2.0.x proxy)
Reviewed by: trawick, jerenkrantz, fielding


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.0.x@151375 13f79535-47bb-0310-9956-ffa450edef68
parent 6338f172
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
Changes with Apache 2.0.53
  *) mod_proxy: Respect errors reported by pre_connection hooks.
     [Jeff Trawick]
  *) --with-module can now take more than one module to be statically
     linked: --with-module=<modtype>:<modfile>,<modtype>:<modfile>,...
     If the <modtype>-subdirectory doesn't exist it will be created and
+16 −2
Original line number Diff line number Diff line
@@ -1027,7 +1027,14 @@ int ap_proxy_ftp_handler(request_rec *r, proxy_server_conf *conf,
     */

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

    /* possible results: */
    /* 120 Service ready in nnn minutes. */
@@ -1772,7 +1779,14 @@ int ap_proxy_ftp_handler(request_rec *r, proxy_server_conf *conf,
    }

    /* 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) {
        data->aborted = 1;
        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
                     "proxy: FTP: pre_connection setup failed (%d)",
                     rc);
        return rc;
    }

    /*
     * VI: Receive the Response ------------------------
+9 −1
Original line number Diff line number Diff line
@@ -304,6 +304,7 @@ apr_status_t ap_proxy_http_create_connection(apr_pool_t *p, request_rec *r,
        }
    }
    if (new) {
        int rc;

        /* create a new socket */
        backend->connection = NULL;
@@ -370,7 +371,14 @@ apr_status_t ap_proxy_http_create_connection(apr_pool_t *p, request_rec *r,
                     p_conn->addr, p_conn->name);

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