You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Dirk-Willem van Gulik <di...@elect6.jrc.it> on 1997/11/21 10:14:00 UTC

Re: [PATCH] fix inetd and -X timeouts (fwd)

Postmaster,

---------- Forwarded message ----------
Date: Fri, 21 Nov 1997 09:20:26 +0100 (CET)
From: "Dirk-Willem van Gulik <di...@elect6.jrc.it>" <di...@cils.plazza.it.>
To: new-httpd@apache.org
Subject: Re: [PATCH] fix inetd and -X timeouts


After a cursory test, yes it does :-) cheers !

Dw.

On Thu, 20 Nov 1997, Dean Gaudet wrote:

> This should fix inetd mode and -X timeouts.  I tested -X only.
> 
> Dean
> 
> Index: main/http_main.c
> ===================================================================
> RCS file: /export/home/cvs/apachen/src/main/http_main.c,v
> retrieving revision 1.252
> diff -u -r1.252 http_main.c
> --- http_main.c	1997/11/16 15:43:16	1.252
> +++ http_main.c	1997/11/20 17:44:07
> @@ -223,6 +223,11 @@
>  
>  int one_process = 0;
>  
> +/* set if timeouts are to be handled by the children and not by the parent.
> + * i.e. child_timeouts = standalone || one_process.
> + */
> +static int child_timeouts;
> +
>  #ifdef DEBUG_SIGSTOP
>  int raise_sigstop_flags;
>  #endif
> @@ -863,12 +868,17 @@
>  #ifndef OPTIMIZE_TIMEOUTS
>      old = alarm(x);
>  #else
> -    /* Just note the timeout in our scoreboard, no need to call the system.
> -     * We also note that the virtual time has gone forward.
> -     */
> -    old = scoreboard_image->servers[my_child_num].timeout_len;
> -    scoreboard_image->servers[my_child_num].timeout_len = x;
> -    ++scoreboard_image->servers[my_child_num].cur_vtime;
> +    if (child_timeouts) {
> +	old = alarm(x);
> +    }
> +    else {
> +	/* Just note the timeout in our scoreboard, no need to call the system.
> +	 * We also note that the virtual time has gone forward.
> +	 */
> +	old = scoreboard_image->servers[my_child_num].timeout_len;
> +	scoreboard_image->servers[my_child_num].timeout_len = x;
> +	++scoreboard_image->servers[my_child_num].cur_vtime;
> +    }
>  #endif
>  #endif
>      return (old);
> @@ -3538,6 +3548,8 @@
>  
>      suexec_enabled = init_suexec();
>      server_conf = read_config(pconf, ptrans, server_confname);
> +
> +    child_timeouts = standalone || one_process;
>  
>      if (standalone) {
>  	open_logs(server_conf, pconf);
> 
> 
>