On 06/26/2007 06:46 PM, jean-frederic clere wrote:
> Ruediger Pluem wrote:

>> Ok, furthermore I think we need to adjust the proxy_status_hook to
>> actually display the string the user configured and not only the path
>> for the cookie. The same is true for the balancer manager (display wise).
>> Missing to split the string at the | in the balancer manager when you
>> enter new data for sticky does not really worry me because setting
>> a new sticky for the balancer (like all other balancer parameters)
>> does not work anyway. We should really disable this.
>>   
> How? Keep the balancer-manager page as it is but "disable" that part.
> (form with fields read only and submit disabled).

I am thinking more about removing it completely like in the attached patch, 
because

1. All information is also displayed without the form.
2. If it turns out that we need the form for the balancer again, because we 
adjusted
   the balancer data structures in a way that changes via the balancer-manager 
work,
   we can fetch it back from svn. IMHO no need to keep "dead" code.


Regards

RĂ¼diger



Index: modules/proxy/mod_proxy_balancer.c
===================================================================
--- modules/proxy/mod_proxy_balancer.c	(Revision 550713)
+++ modules/proxy/mod_proxy_balancer.c	(Arbeitskopie)
@@ -649,33 +649,6 @@
         }
     }
     /* First set the params */
-    if (bsel) {
-        const char *val;
-        if ((val = apr_table_get(params, "ss"))) {
-            if (strlen(val))
-                bsel->sticky = apr_pstrdup(conf->pool, val);
-            else
-                bsel->sticky = NULL;
-        }
-        if ((val = apr_table_get(params, "tm"))) {
-            int ival = atoi(val);
-            if (ival >= 0)
-                bsel->timeout = apr_time_from_sec(ival);
-        }
-        if ((val = apr_table_get(params, "fa"))) {
-            int ival = atoi(val);
-            if (ival >= 0)
-                bsel->max_attempts = ival;
-            bsel->max_attempts_set = 1;
-        }
-        if ((val = apr_table_get(params, "lm"))) {
-            proxy_balancer_method *provider;
-            provider = ap_lookup_provider(PROXY_LBMETHOD, val, "0");
-            if (provider) {
-                bsel->lbmethod = provider;
-            }
-        }
-    }
     if (wsel) {
         const char *val;
         if ((val = apr_table_get(params, "lf"))) {
@@ -755,10 +728,7 @@
         for (i = 0; i < conf->balancers->nelts; i++) {
 
             ap_rputs("<hr />\n<h3>LoadBalancer Status for ", r);
-            ap_rvputs(r, "<a href=\"", r->uri, "?b=",
-                      balancer->name + sizeof("balancer://") - 1,
-                      "\">", NULL);
-            ap_rvputs(r, balancer->name, "</a></h3>\n\n", NULL);
+            ap_rvputs(r, balancer->name, "</h3>\n\n", NULL);
             ap_rputs("\n\n<table border=\"0\" style=\"text-align: left;\"><tr>"
                 "<th>StickySession</th><th>Timeout</th><th>FailoverAttempts</th><th>Method</th>"
                 "</tr>\n<tr>", r);
@@ -843,41 +813,6 @@
                       "\">\n</form>\n", NULL);
             ap_rputs("<hr />\n", r);
         }
-        else if (bsel) {
-            ap_rputs("<h3>Edit balancer settings for ", r);
-            ap_rvputs(r, bsel->name, "</h3>\n", NULL);
-            ap_rvputs(r, "<form method=\"GET\" action=\"", NULL);
-            ap_rvputs(r, r->uri, "\">\n<dl>", NULL);
-            ap_rputs("<table><tr><td>StickySession Identifier:</td><td><input name=\"ss\" type=text ", r);
-            if (bsel->sticky)
-                ap_rvputs(r, "value=\"", bsel->sticky, "\"", NULL);
-            ap_rputs("></td><tr>\n<tr><td>Timeout:</td><td><input name=\"tm\" type=text ", r);
-            ap_rprintf(r, "value=\"%" APR_TIME_T_FMT "\"></td></tr>\n",
-                       apr_time_sec(bsel->timeout));
-            ap_rputs("<tr><td>Failover Attempts:</td><td><input name=\"fa\" type=text ", r);
-            ap_rprintf(r, "value=\"%d\"></td></tr>\n",
-                       bsel->max_attempts);
-            ap_rputs("<tr><td>LB Method:</td><td><select name=\"lm\">", r);
-            {
-                apr_array_header_t *methods;
-                ap_list_provider_names_t *method;
-                int i;
-                methods = ap_list_provider_names(r->pool, PROXY_LBMETHOD, "0");
-                method = (ap_list_provider_names_t *)methods->elts;
-                for (i = 0; i < methods->nelts; i++) {
-                    ap_rprintf(r, "<option value=\"%s\" %s>%s</option>", method->provider_name,
-                       (!strcasecmp(bsel->lbmethod->name, method->provider_name)) ? "selected" : "",
-                       method->provider_name);
-                    method++;
-                }
-            }
-            ap_rputs("</select></td></tr>\n", r);
-            ap_rputs("<tr><td colspan=2><input type=submit value=\"Submit\"></td></tr>\n", r);
-            ap_rvputs(r, "</table>\n<input type=hidden name=\"b\" ", NULL);
-            ap_rvputs(r, "value=\"", bsel->name + sizeof("balancer://") - 1,
-                      "\">\n</form>\n", NULL);
-            ap_rputs("<hr />\n", r);
-        }
         ap_rputs(ap_psignature("",r), r);
         ap_rputs("</body></html>\n", r);
     }

Reply via email to