httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rpl...@apache.org
Subject svn commit: r293123 - /httpd/httpd/trunk/modules/proxy/mod_proxy.c
Date Sun, 02 Oct 2005 14:32:50 GMT
Author: rpluem
Date: Sun Oct  2 07:32:35 2005
New Revision: 293123

URL: http://svn.apache.org/viewcvs?rev=293123&view=rev
Log:
* 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

Modified:
    httpd/httpd/trunk/modules/proxy/mod_proxy.c

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/proxy/mod_proxy.c?rev=293123&r1=293122&r2=293123&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy.c Sun Oct  2 07:32:35 2005
@@ -679,8 +679,22 @@
         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 */



Mime
View raw message