]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Make the 'need to reset' more generic by extending its reach
authorJim Jagielski <jim@apache.org>
Thu, 31 Mar 2011 19:29:21 +0000 (19:29 +0000)
committerJim Jagielski <jim@apache.org>
Thu, 31 Mar 2011 19:29:21 +0000 (19:29 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1087415 13f79535-47bb-0310-9956-ffa450edef68

modules/proxy/mod_proxy_balancer.c

index dc7567495b29cb53d9de0676465f13691401e0f2..f59bd0b6b11b7bd036c89ce28acb686211b635d8 100644 (file)
@@ -977,6 +977,8 @@ static int balancer_handler(request_rec *r)
     /* First set the params */
     if (wsel && ok2change) {
         const char *val;
+        int was_usable = PROXY_WORKER_IS_USABLE(wsel);
+
         ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "settings worker params");
 
         if ((val = apr_table_get(params, "w_lf"))) {
@@ -1006,12 +1008,7 @@ static int balancer_handler(request_rec *r)
             ap_proxy_set_wstatus('N', atoi(val), wsel);
         }
         if ((val = apr_table_get(params, "w_status_D"))) {
-            int was_usable = PROXY_WORKER_IS_USABLE(wsel);
             ap_proxy_set_wstatus('D', atoi(val), wsel);
-            /* if enabling, we need to reset all lb params */
-            if (!was_usable && PROXY_WORKER_IS_USABLE(wsel)) {
-                bsel->s->need_reset = 1;
-            }
         }
         if ((val = apr_table_get(params, "w_status_H"))) {
             ap_proxy_set_wstatus('H', atoi(val), wsel);
@@ -1022,6 +1019,10 @@ static int balancer_handler(request_rec *r)
                 wsel->s->lbset = ival;
              }
         }
+        /* if enabling, we need to reset all lb params */
+        if (bsel && !was_usable && PROXY_WORKER_IS_USABLE(wsel)) {
+            bsel->s->need_reset = 1;
+        }
 
     }