]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mod_proxy: Respect errors reported by pre_connection hooks.
authorJustin Erenkrantz <jerenkrantz@apache.org>
Fri, 4 Feb 2005 17:34:25 +0000 (17:34 +0000)
committerJustin Erenkrantz <jerenkrantz@apache.org>
Fri, 4 Feb 2005 17:34:25 +0000 (17:34 +0000)
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

CHANGES
modules/proxy/proxy_ftp.c
modules/proxy/proxy_http.c

diff --git a/CHANGES b/CHANGES
index d9fb8bed6bd61c574723e6cf30e0ef19bb23a074..cf41935102fbaeaaac7f2a256536f047fb5c6e96 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,8 @@
 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
index 245fc015f882e2cb3d1d77c0cd7639e06b9ccda4..d118a58414365469435d60c36621f34c258f8e23 100644 (file)
@@ -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 ------------------------
index e23e5a29e5e7abee5c2aea12669a7d05181d2d73..8d16bd8892db873b506a1b97a05fe0a07ca81c8f 100644 (file)
@@ -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;
 }