httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r1067276 - /httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c
Date Fri, 04 Feb 2011 20:34:48 GMT
Author: jim
Date: Fri Feb  4 20:34:47 2011
New Revision: 1067276

URL: http://svn.apache.org/viewvc?rev=1067276&view=rev
Log:
Lock around the time when we're mucking w/ balancers...

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

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c?rev=1067276&r1=1067275&r2=1067276&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c Fri Feb  4 20:34:47 2011
@@ -876,8 +876,20 @@ static int balancer_handler(request_rec 
     params = apr_table_make(r->pool, 10);
 
     balancer = (proxy_balancer *)conf->balancers->elts;
-    for (i = 0; i < conf->balancers->nelts; i++, balancer++)
+    for (i = 0; i < conf->balancers->nelts; i++, balancer++) {
+        apr_status_t rv;
+        if ((rv = PROXY_GLOBAL_LOCK(balancer)) != APR_SUCCESS) {
+            ap_log_error(APLOG_MARK, APLOG_ERR, rv, r->server,
+                         "proxy: BALANCER: (%s). Lock failed for balancer_handler",
+                         balancer->name);
+        }
         ap_proxy_update_members(balancer, r->server, conf);
+        if ((rv = PROXY_GLOBAL_UNLOCK(balancer)) != APR_SUCCESS) {
+            ap_log_error(APLOG_MARK, APLOG_ERR, rv, r->server,
+                         "proxy: BALANCER: (%s). Unlock failed for balancer_handler",
+                         balancer->name);
+        }
+    }
 
     if (r->args) {
         char *args = apr_pstrdup(r->pool, r->args);



Mime
View raw message