From: Greg Ames Date: Thu, 12 Jul 2001 03:20:50 +0000 (+0000) Subject: scratch an old itch - give lingering close its own state in the scoreboard. X-Git-Tag: 2.0.21~63 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5139e492bda2dde0256d464fef3e8662c814a5ae;p=apache scratch an old itch - give lingering close its own state in the scoreboard. clean up SERVER_ACCEPTING and SERVER_QUEUEING (never set) while I'm at it. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89542 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/include/scoreboard.h b/include/scoreboard.h index f36ec5ee8c..d8acd84c6b 100644 --- a/include/scoreboard.h +++ b/include/scoreboard.h @@ -91,11 +91,10 @@ extern "C" { #define SERVER_BUSY_KEEPALIVE 5 /* Waiting for more requests via keepalive */ #define SERVER_BUSY_LOG 6 /* Logging the request */ #define SERVER_BUSY_DNS 7 /* Looking up a hostname */ -#define SERVER_GRACEFUL 8 /* server is gracefully finishing request */ -#define SERVER_ACCEPTING 9 /* thread is accepting connections */ -#define SERVER_QUEUEING 10 /* thread is putting connection on the queue */ -#define SERVER_IDLE_KILL 11 /* Server is cleaning up idle children. */ -#define SERVER_NUM_STATUS 12 /* number of status settings */ +#define SERVER_CLOSING 8 /* Closing the connection */ +#define SERVER_GRACEFUL 9 /* server is gracefully finishing request */ +#define SERVER_IDLE_KILL 10 /* Server is cleaning up idle children. */ +#define SERVER_NUM_STATUS 11 /* number of status settings */ /* Type used for generation indicies. Startup and every restart cause a * new generation of children to be spawned. Children within the same diff --git a/modules/generators/mod_status.c b/modules/generators/mod_status.c index 42843fc699..eafceb0bcf 100644 --- a/modules/generators/mod_status.c +++ b/modules/generators/mod_status.c @@ -464,8 +464,9 @@ static int status_handler(request_rec *r) ap_rputs("\"W\" Sending Reply, \n", r); ap_rputs("\"K\" Keepalive (read), \n", r); ap_rputs("\"D\" DNS Lookup,
\n", r); + ap_rputs("\"C\" Closing connection, \n", r); ap_rputs("\"L\" Logging, \n", r); - ap_rputs("\"G\" Gracefully finishing, \n", r); + ap_rputs("\"G\" Gracefully finishing,
\n", r); ap_rputs("\"I\" Idle cleanup of worker, \n", r); ap_rputs("\".\" Open slot with no current process

\n", r); ap_rputs("

\n", r); @@ -585,6 +586,9 @@ static int status_handler(request_rec *r) case SERVER_BUSY_DNS: ap_rputs("DNS lookup", r); break; + case SERVER_CLOSING: + ap_rputs("Closing", r); + break; case SERVER_DEAD: ap_rputs("Dead", r); break; @@ -659,6 +663,9 @@ static int status_handler(request_rec *r) case SERVER_BUSY_DNS: ap_rputs("D", r); break; + case SERVER_CLOSING: + ap_rputs("C", r); + break; case SERVER_DEAD: ap_rputs(".", r); break; @@ -764,6 +771,7 @@ static void status_init(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, serv status_flags[SERVER_BUSY_KEEPALIVE] = 'K'; status_flags[SERVER_BUSY_LOG] = 'L'; status_flags[SERVER_BUSY_DNS] = 'D'; + status_flags[SERVER_CLOSING] = 'C'; status_flags[SERVER_GRACEFUL] = 'G'; status_flags[SERVER_IDLE_KILL] = 'I'; } diff --git a/server/connection.c b/server/connection.c index 3f706a5e24..70f9fc29ba 100644 --- a/server/connection.c +++ b/server/connection.c @@ -157,6 +157,8 @@ void ap_lingering_close(conn_rec *c) apr_int32_t timeout; apr_int32_t total_linger_time = 0; + ap_update_child_status(AP_CHILD_THREAD_FROM_ID(c->id), SERVER_CLOSING, NULL); + #ifdef NO_LINGCLOSE ap_flush_conn(c); /* just close it */ apr_socket_close(c->client_socket); diff --git a/server/scoreboard.c b/server/scoreboard.c index a6237f9235..d9398a4a4f 100644 --- a/server/scoreboard.c +++ b/server/scoreboard.c @@ -279,7 +279,7 @@ int ap_update_child_status(int child_num, int thread_num, int status, request_re ps = &ap_scoreboard_image->parent[child_num]; - if ((status == SERVER_READY || status == SERVER_ACCEPTING) + if (status == SERVER_READY && old_status == SERVER_STARTING) { ws->thread_num = child_num * HARD_SERVER_LIMIT + thread_num; ps->generation = ap_my_generation;