httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yla...@apache.org
Subject svn commit: r1739146 - /httpd/httpd/trunk/server/scoreboard.c
Date Thu, 14 Apr 2016 18:03:59 GMT
Author: ylavic
Date: Thu Apr 14 18:03:58 2016
New Revision: 1739146

URL: http://svn.apache.org/viewvc?rev=1739146&view=rev
Log:
scoreboard/status: follow up to r1739008.
Restore (completely) pre-2.4.20 behaviour w.r.t. preserved values.
r1739008 was still unnessessarily blanking some values for the time of
BUSY_READ -> BUSY_WRITE (with blocking MPMs).

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

Modified: httpd/httpd/trunk/server/scoreboard.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/scoreboard.c?rev=1739146&r1=1739145&r2=1739146&view=diff
==============================================================================
--- httpd/httpd/trunk/server/scoreboard.c (original)
+++ httpd/httpd/trunk/server/scoreboard.c Thu Apr 14 18:03:58 2016
@@ -464,22 +464,18 @@ static int update_child_status_internal(
 {
     int old_status;
     worker_score *ws;
-    process_score *ps;
     int mpm_generation;
 
     ws = &ap_scoreboard_image->servers[child_num][thread_num];
     old_status = ws->status;
-    if (status >= 0) {
-        ws->status = status;
-        
-        ps = &ap_scoreboard_image->parent[child_num];
-        
-        if (status == SERVER_READY
-            && old_status == SERVER_STARTING) {
-            ws->thread_num = child_num * thread_limit + thread_num;
-            ap_mpm_query(AP_MPMQ_GENERATION, &mpm_generation);
-            ps->generation = mpm_generation;
-        }
+    ws->status = status;
+    
+    if (status == SERVER_READY
+        && old_status == SERVER_STARTING) {
+        process_score *ps = &ap_scoreboard_image->parent[child_num];
+        ws->thread_num = child_num * thread_limit + thread_num;
+        ap_mpm_query(AP_MPMQ_GENERATION, &mpm_generation);
+        ps->generation = mpm_generation;
     }
 
     if (ap_extended_status) {
@@ -499,57 +495,41 @@ static int update_child_status_internal(
         }
 
         /* 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));
-                else
-                    apr_cpystrn(ws->client, val, sizeof(ws->client));
-            }
-            else if (c) {
-                if (!(val = ap_get_remote_host(c, c->base_server->lookup_defaults,
-                                               REMOTE_NOLOOKUP, NULL)))
-                    apr_cpystrn(ws->client, c->client_ip, sizeof(ws->client));
-                else
-                    apr_cpystrn(ws->client, val, sizeof(ws->client));
-            }
-            else if (was_ready) {
-                ws->client[0] = '\0';
-            }
+        if (descr) {
+            apr_cpystrn(ws->request, descr, sizeof(ws->request));
+        }
+        else if (r) {
+            copy_request(ws->request, sizeof(ws->request), r);
+        }
 
-            if (s) {
-                if (c) {
-                    apr_snprintf(ws->vhost, sizeof(ws->vhost), "%s:%d",
-                                 s->server_hostname, c->local_addr->port);
-                }
-                else {
-                    apr_cpystrn(ws->vhost, s->server_hostname, sizeof(ws->vhost));
-                }
-            }
-            else if (was_ready) {
-                ws->vhost[0] = '\0';
-            }
+        if (r) {
+            if (!(val = ap_get_useragent_host(r, REMOTE_NOLOOKUP, NULL)))
+                apr_cpystrn(ws->client, r->useragent_ip, sizeof(ws->client));
+            else
+                apr_cpystrn(ws->client, val, sizeof(ws->client));
+        }
+        else if (c) {
+            if (!(val = ap_get_remote_host(c, c->base_server->lookup_defaults,
+                                           REMOTE_NOLOOKUP, NULL)))
+                apr_cpystrn(ws->client, c->client_ip, sizeof(ws->client));
+            else
+                apr_cpystrn(ws->client, val, sizeof(ws->client));
+        }
 
+        if (s) {
             if (c) {
-                val = ap_get_protocol(c);
-                apr_cpystrn(ws->protocol, val, sizeof(ws->protocol));
+                apr_snprintf(ws->vhost, sizeof(ws->vhost), "%s:%d",
+                             s->server_hostname, c->local_addr->port);
             }
-            else if (was_ready) {
-                ws->protocol[0] = '\0';
+            else {
+                apr_cpystrn(ws->vhost, s->server_hostname, sizeof(ws->vhost));
             }
         }
+
+        if (c) {
+            val = ap_get_protocol(c);
+            apr_cpystrn(ws->protocol, val, sizeof(ws->protocol));
+        }
     }
 
     return old_status;



Mime
View raw message