You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by yl...@apache.org on 2016/04/13 23:04:59 UTC

svn commit: r1739008 - in /httpd/httpd/trunk: CHANGES server/scoreboard.c

Author: ylavic
Date: Wed Apr 13 21:04:59 2016
New Revision: 1739008

URL: http://svn.apache.org/viewvc?rev=1739008&view=rev
Log:
scoreboard/status: Keep previous worker connection/request data when idle as
prior to 2.4.20.

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/server/scoreboard.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1739008&r1=1739007&r2=1739008&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Wed Apr 13 21:04:59 2016
@@ -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>]
 

Modified: httpd/httpd/trunk/server/scoreboard.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/scoreboard.c?rev=1739008&r1=1739007&r2=1739008&view=diff
==============================================================================
--- httpd/httpd/trunk/server/scoreboard.c (original)
+++ httpd/httpd/trunk/server/scoreboard.c Wed Apr 13 21:04:59 2016
@@ -497,19 +497,21 @@ static int update_child_status_internal(
             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(
                 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(
                     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';
+            }
         }
     }