]> granicus.if.org Git - apache/commitdiff
scoreboard/status: Keep previous worker connection/request data when idle as
authorYann Ylavic <ylavic@apache.org>
Wed, 13 Apr 2016 21:04:59 +0000 (21:04 +0000)
committerYann Ylavic <ylavic@apache.org>
Wed, 13 Apr 2016 21:04:59 +0000 (21:04 +0000)
prior to 2.4.20.

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

CHANGES
server/scoreboard.c

diff --git a/CHANGES b/CHANGES
index 0ef2feaaf48a9e3727fb449fda4519790a2b1483..7b9c3f4bbde010113ad70b24d0b067c1cdd96e27 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) scoreboard/status: Keep previous worker connection/request data when idle as
+     prior to 2.4.20.  [Yann Ylavic]
+
   *) mod_proxy_ajp: Add "secret" parameter to proxy workers to implement legacy
      AJP13 authentication.  PR 53098.  [Dmitry A. Bakshaev <dab1818 gmail com>]
 
index c6e8a4e00ca8248e74a8f8e8d4cbeef0094a41ba..af2e9d1f4c6d30439d7541d4b57fccb12c9c8e1f 100644 (file)
@@ -497,19 +497,21 @@ static int update_child_status_internal(int child_num,
             ws->conn_bytes = 0;
             ws->last_used = apr_time_now();
         }
-        if (status == SERVER_READY) {
-            ws->client[0]='\0';
-            ws->vhost[0]='\0';
-            ws->request[0]='\0';
-            ws->protocol[0]='\0';
-        }
-        else {
+
+        /* Keep existing values until working again */
+        if (status > SERVER_READY) {
+            int was_ready = (old_status == SERVER_READY);
+
             if (descr) {
                 apr_cpystrn(ws->request, descr, sizeof(ws->request));
             }
             else if (r) {
                 copy_request(ws->request, sizeof(ws->request), r);
             }
+            else if (was_ready) {
+                ws->request[0] = '\0';
+            }
+
             if (r) {
                 if (!(val = ap_get_useragent_host(r, REMOTE_NOLOOKUP, NULL)))
                     apr_cpystrn(ws->client, r->useragent_ip, sizeof(ws->client));
@@ -523,6 +525,10 @@ static int update_child_status_internal(int child_num,
                 else
                     apr_cpystrn(ws->client, val, sizeof(ws->client));
             }
+            else if (was_ready) {
+                ws->client[0] = '\0';
+            }
+
             if (s) {
                 if (c) {
                     apr_snprintf(ws->vhost, sizeof(ws->vhost), "%s:%d",
@@ -532,10 +538,17 @@ static int update_child_status_internal(int child_num,
                     apr_cpystrn(ws->vhost, s->server_hostname, sizeof(ws->vhost));
                 }
             }
+            else if (was_ready) {
+                ws->vhost[0] = '\0';
+            }
+
             if (c) {
                 val = ap_get_protocol(c);
                 apr_cpystrn(ws->protocol, val, sizeof(ws->protocol));
             }
+            else if (was_ready) {
+                ws->protocol[0] = '\0';
+            }
         }
     }