From: Roy T. Fielding Date: Thu, 26 Apr 2001 00:33:14 +0000 (+0000) Subject: Removed the keptalive boolean from conn_rec because it is now only X-Git-Tag: 2.0.18~160 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a529c242faf7cf37fe228022235f2569e12e7783;p=apache Removed the keptalive boolean from conn_rec because it is now only used by a single routine and can be replaced by a local variable. Submitted by: Greg Stein, Ryan Bloom, Roy Fielding git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88938 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 39b633cef1..baee74e04e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with Apache 2.0.18-dev + *) Removed the keptalive boolean from conn_rec because it is now only + used by a single routine and can be replaced by a local variable. + [Greg Stein, Ryan Bloom, Roy Fielding] + *) Patch prefork to put enough of the signal processing back in so that signals are all handled properly now. The previous patch fixed the deadlock race condition, but broke the user directed signal handling. diff --git a/include/httpd.h b/include/httpd.h index 27423fc17a..ca3fe2043b 100644 --- a/include/httpd.h +++ b/include/httpd.h @@ -858,10 +858,11 @@ struct conn_rec { /** Are we still talking? */ unsigned aborted:1; - /** Are we using HTTP Keep-Alive? -1 fatal error, 0 undecided, 1 yes */ + + /** Are we going to keep the connection alive for another request? + * -1 fatal error, 0 undecided, 1 yes */ signed int keepalive:2; - /** Did we use HTTP Keep-Alive? */ - unsigned keptalive:1; + /** have we done double-reverse DNS? -1 yes/failure, 0 not yet, * 1 yes/success */ signed int double_reverse:2; diff --git a/server/protocol.c b/server/protocol.c index 8b14fb7d31..93db7c32d0 100644 --- a/server/protocol.c +++ b/server/protocol.c @@ -547,7 +547,7 @@ request_rec *ap_read_request(conn_rec *conn) request_rec *r; apr_pool_t *p; const char *expect; - int access_status; + int access_status, keptalive; apr_pool_create(&p, conn->pool); r = apr_pcalloc(p, sizeof(request_rec)); @@ -555,7 +555,7 @@ request_rec *ap_read_request(conn_rec *conn) r->connection = conn; r->server = conn->base_server; - conn->keptalive = conn->keepalive == 1; + keptalive = conn->keepalive == 1; conn->keepalive = 0; r->user = NULL; @@ -584,7 +584,7 @@ request_rec *ap_read_request(conn_rec *conn) r->input_filters = conn->input_filters; apr_setsocketopt(conn->client_socket, APR_SO_TIMEOUT, - (int)(conn->keptalive + (int)(keptalive ? r->server->keep_alive_timeout * APR_USEC_PER_SEC : r->server->timeout * APR_USEC_PER_SEC)); @@ -603,7 +603,7 @@ request_rec *ap_read_request(conn_rec *conn) } return NULL; } - if (r->connection->keptalive) { + if (keptalive) { apr_setsocketopt(r->connection->client_socket, APR_SO_TIMEOUT, (int)(r->server->timeout * APR_USEC_PER_SEC)); } @@ -645,8 +645,6 @@ request_rec *ap_read_request(conn_rec *conn) /* we may have switched to another server */ r->per_dir_config = r->server->lookup_defaults; - conn->keptalive = 0; /* We now have a request to play with */ - if ((!r->hostname && (r->proto_num >= HTTP_VERSION(1,1))) || ((r->proto_num == HTTP_VERSION(1,1)) && !apr_table_get(r->headers_in, "Host"))) {