]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r293123, r293293 from trunk:
authorRuediger Pluem <rpluem@apache.org>
Thu, 6 Oct 2005 21:30:58 +0000 (21:30 +0000)
committerRuediger Pluem <rpluem@apache.org>
Thu, 6 Oct 2005 21:30:58 +0000 (21:30 +0000)
* run the request_status hook in proxy_handler if HTTP_SERVICE_UNAVAILABLE
  is returned by ap_proxy_pre_request.

Suggested by: Brian Akins <brian.akins turner.com>, Mladen Turk
Reviewed by: Jim Jagielski

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@306900 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/proxy/mod_proxy.c

diff --git a/CHANGES b/CHANGES
index ea7f7be622ce0b6fe1d796d31b0872afc748dca7..65c62b1ee2b94c527ac527678fff4f52664a348d 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,10 @@
                                                         -*- coding: utf-8 -*-
 Changes with Apache 2.1.9
 
+  *) mod_proxy: Run the request_status hook also if there are no free workers
+     or all workers are in error state.
+     [Ruediger Pluem, Brian Akins <brian.akins turner.com>]
+
   *) mod_proxy_connect: Fix high CPU loop on systems like UnixWare which
      trigger POLL_ERR or POLL_HUP on a terminated connection.  PR 36951.
      [Jeff Trawick, Ruediger Pluem]
index f49493a25ee4b4951c2cc924b087611e987cdbcf..568c9be777e2b8d8a8890a3fed90cef3c9b535e2 100644 (file)
@@ -679,8 +679,22 @@ static int proxy_handler(request_rec *r)
         char *url = uri;
         /* Try to obtain the most suitable worker */
         access_status = ap_proxy_pre_request(&worker, &balancer, r, conf, &url);
-        if (access_status != OK)
-            return access_status;
+        if (access_status != OK) {
+            /*
+             * Only return if access_status is not HTTP_SERVICE_UNAVAILABLE
+             * This gives other modules the chance to hook into the
+             * request_status hook and decide what to do in this situation.
+             */
+            if (access_status != HTTP_SERVICE_UNAVAILABLE)
+                return access_status;
+            /*
+             * Ensure that balancer is NULL if worker is NULL to prevent
+             * potential problems in the post_request hook.
+             */
+            if (!worker)
+                balancer = NULL;
+            goto cleanup;
+        }
         if (balancer && balancer->max_attempts_set && !max_attempts)
             max_attempts = balancer->max_attempts;
         /* firstly, try a proxy, unless a NoProxy directive is active */