]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mod_proxy: Respect errors reported by pre_connection hooks.
authorJeff Trawick <trawick@apache.org>
Wed, 8 Dec 2004 20:19:04 +0000 (20:19 +0000)
committerJeff Trawick <trawick@apache.org>
Wed, 8 Dec 2004 20:19:04 +0000 (20:19 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@111304 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/proxy/proxy_ftp.c
modules/proxy/proxy_util.c

diff --git a/CHANGES b/CHANGES
index 2c7990d28c5f743ab7990b5f1df1dcd454c2fa5c..ab1077cfb65a6b6a8a7722b4e1c6dc48cbca6da5 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -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]
 
index 113593ed80d61f552a52065b928300c7e90b0eaa..b0e9b41dc0691858abdb5c2d1a3855533ca1124d 100644 (file)
@@ -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 ------------------------
index 0bf1430d7bcb2fe916b1d5df41e52d2f3bc5ec9d..331ba1619e53e95547a7d2db1b434168c7a66a29 100644 (file)
@@ -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;
 }