httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yann Ylavic <ylavic....@gmail.com>
Subject Re: KeepAliveTimeout per vhost for non-async MPMs
Date Tue, 03 Mar 2015 16:51:33 GMT
On Tue, Mar 3, 2015 at 5:36 PM, Yann Ylavic <ylavic.dev@gmail.com> wrote:
>
> I propose to simply :
>
> Index: modules/http/http_core.c
> ===================================================================
> --- modules/http/http_core.c    (revision 1663701)
> +++ modules/http/http_core.c    (working copy)
> @@ -179,6 +179,8 @@ static int ap_process_http_sync_connection(conn_re
>
>      ap_update_child_status_from_conn(c->sbh, SERVER_BUSY_READ, c);
>      while ((r = ap_read_request(c)) != NULL) {
> +        apr_interval_time_t keep_alive_timeout =
> +                                r->server->keep_alive_timeout;

Maybe would could even :
+        c->base_server = r->server;
here...

>
>          c->keepalive = AP_CONN_UNKNOWN;
>          /* process the request if it was read without error */
> @@ -215,7 +217,7 @@ static int ap_process_http_sync_connection(conn_re
>              csd = ap_get_conn_socket(c);
>          }
>          apr_socket_opt_set(csd, APR_INCOMPLETE_READ, 1);
> -        apr_socket_timeout_set(csd, c->base_server->keep_alive_timeout);
> +        apr_socket_timeout_set(csd, keep_alive_timeout);

and don't need this.

>          /* Go straight to select() to wait for the next request */
>      }
> --

Hence we could figure out the exact server from a given c everywhere
even with named based vhosts.
(this may not be expected though).

Mime
View raw message