]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
as not everyone needs sticky sessions - avoid segfault in balancer manager and
authorAndré Malo <nd@apache.org>
Tue, 4 Sep 2007 23:09:24 +0000 (23:09 +0000)
committerAndré Malo <nd@apache.org>
Tue, 4 Sep 2007 23:09:24 +0000 (23:09 +0000)
mod_status

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@572832 13f79535-47bb-0310-9956-ffa450edef68

modules/proxy/mod_proxy.c
modules/proxy/mod_proxy_balancer.c

index df613fe2fe2a2558e37cdc392ef65414e4b8ab62..93921b87616ff8dbfe51890fe4126f1bb01ca7f3 100644 (file)
@@ -2075,12 +2075,17 @@ static int proxy_status_hook(request_rec *r, int flags)
         ap_rputs("\n\n<table border=\"0\"><tr>"
                  "<th>SSes</th><th>Timeout</th><th>Method</th>"
                  "</tr>\n<tr>", r);
-        if (strcmp(balancer->sticky, balancer->sticky_path)) {
-            ap_rvputs(r, "<td>", balancer->sticky, " | ", balancer->sticky_path,
-                      NULL);
+        if (balancer->sticky) {
+            if (strcmp(balancer->sticky, balancer->sticky_path)) {
+                ap_rvputs(r, "<td>", balancer->sticky, " | ",
+                          balancer->sticky_path, NULL);
+            }
+            else {
+                ap_rvputs(r, "<td>", balancer->sticky, NULL);
+            }
         }
         else {
-            ap_rvputs(r, "<td>", balancer->sticky, NULL);
+            ap_rputs("<td> - ", r);
         }
         ap_rprintf(r, "</td><td>%" APR_TIME_T_FMT "</td>",
                    apr_time_sec(balancer->timeout));
index 1a1d77633450a74d6ca71937675b3b0103410eb2..9d9c1fc5603a080dcf9a983aebee0f57300ff6f7 100644 (file)
@@ -758,11 +758,17 @@ static int balancer_handler(request_rec *r)
             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);
-            if (strcmp(balancer->sticky, balancer->sticky_path)) {
-                ap_rvputs(r, "<td>", balancer->sticky, " | ", balancer->sticky_path, NULL);
+            if (balancer->sticky) {
+                if (strcmp(balancer->sticky, balancer->sticky_path)) {
+                    ap_rvputs(r, "<td>", balancer->sticky, " | ",
+                              balancer->sticky_path, NULL);
+                }
+                else {
+                    ap_rvputs(r, "<td>", balancer->sticky, NULL);
+                }
             }
             else {
-                ap_rvputs(r, "<td>", balancer->sticky, NULL);
+                ap_rputs("<td> - ", r);
             }
             ap_rprintf(r, "</td><td>%" APR_TIME_T_FMT "</td>",
                 apr_time_sec(balancer->timeout));