From: Yann Ylavic Date: Wed, 13 Apr 2016 21:04:59 +0000 (+0000) Subject: scoreboard/status: Keep previous worker connection/request data when idle as X-Git-Tag: 2.5.0-alpha~1749 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2c0b2d7b31ab3f2f7e0492f84239fe8ac050fde5;p=apache scoreboard/status: Keep previous worker connection/request data when idle as prior to 2.4.20. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1739008 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 0ef2feaaf4..7b9c3f4bbd 100644 --- 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 ] diff --git a/server/scoreboard.c b/server/scoreboard.c index c6e8a4e00c..af2e9d1f4c 100644 --- a/server/scoreboard.c +++ b/server/scoreboard.c @@ -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'; + } } }