httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Slemko <ma...@znep.com>
Subject Re: [PATCH] buff.c bug fix
Date Sat, 25 Jan 1997 23:35:00 GMT
+1

On Sat, 25 Jan 1997, Alexei Kosut wrote:

> On Sat, 25 Jan 1997, Dean Gaudet wrote:
> 
> > I'd actually like this patch to allow me to explicitly set the keepalive
> > to a high number if I want to.  For the tests I'm doing right now with
> > pipelining I'm using 70 some-odd inlined images.  I've also seen setups
> > where a proxy is fronting another webserver and a pipeline could easily be
> > set up which you'd never want torn down... 
> 
> Ideally, I'd like to never tear it down either, but as I said, the
> logic in set_keep_alive is a tad confusing anyway, I don't want to go
> messing with it this late in the beta cycle.
> 
> Anyhow, here's a revised patch that fixes a few things with my other
> patch, and also adds the NCSA directive MaxKeepAliveRequests, which
> does what Apache's current KeepAlive does. In other words, with this
> patch, "KeepAlive [anything but "Off" or "0"]" will turn on keep-alive
> and set it to 100 requests. A "MaxKeepAliveRequests 377" following
> that, for example, would set it to 377.
> 
> What's the point of this? It makes it so current configs won't
> continue to have low keep-alive values, and eventually (in 2.0,
> probably) we can get rid of the limit entirely.
> 
> Index: http_core.c
> ===================================================================
> RCS file: /export/home/cvs/apache/src/http_core.c,v
> retrieving revision 1.60
> diff -c -r1.60 http_core.c
> *** http_core.c	1997/01/24 07:42:45	1.60
> --- http_core.c	1997/01/25 19:51:00
> ***************
> *** 899,904 ****
> --- 899,916 ----
>   }
>   
>   const char *set_keep_alive (cmd_parms *cmd, void *dummy, char *arg) {
> +     /* We've changed it to On/Off, but used to use numbers
> +      * so we accept anything but "Off" or "0" as "On"
> +      */
> +     if (!strcasecmp(arg, "off") || !strcmp(arg, "0"))
> + 	cmd->server->keep_alive = 0;
> +     else
> + 	/* We don't really want them to go on forever... */
> + 	cmd->server->keep_alive = DEFAULT_KEEPALIVE;
> +     return NULL;
> + }
> + 
> + const char *set_keep_alive_max (cmd_parms *cmd, void *dummy, char *arg) {
>       cmd->server->keep_alive = atoi (arg);
>       return NULL;
>   }
> ***************
> *** 1172,1178 ****
>     "The pathname the server can be reached at" },
>   { "Timeout", set_timeout, NULL, RSRC_CONF, TAKE1, "Timeout duration (sec)"},
>   { "KeepAliveTimeout", set_keep_alive_timeout, NULL, RSRC_CONF, TAKE1, "Keep-Alive timeout
duration (sec)"},
> ! { "KeepAlive", set_keep_alive, NULL, RSRC_CONF, TAKE1, "Maximum Keep-Alive requests
per connection (0 to disable)" },
>   { "IdentityCheck", set_idcheck, NULL, RSRC_CONF|ACCESS_CONF, FLAG, "Enable identd (RFC931)
user lookups - SLOW" },
>   { "ContentDigest", set_content_md5, NULL, RSRC_CONF|ACCESS_CONF|OR_AUTHCFG, FLAG, "whether
or not to send a Content-MD5 header with each request" },
>   { "StartServers", set_daemons_to_start, NULL, RSRC_CONF, TAKE1, "Number of child processes
launched at server startup" },
> --- 1184,1191 ----
>     "The pathname the server can be reached at" },
>   { "Timeout", set_timeout, NULL, RSRC_CONF, TAKE1, "Timeout duration (sec)"},
>   { "KeepAliveTimeout", set_keep_alive_timeout, NULL, RSRC_CONF, TAKE1, "Keep-Alive timeout
duration (sec)"},
> ! { "MaxKeepAliveRequests", set_keep_alive_max, NULL, RSRC_CONF, TAKE1, "Maximum number
of Keep-Alive requests per connection" },
> ! { "KeepAlive", set_keep_alive, NULL, RSRC_CONF, TAKE1, "Whether persistent connections
should be On or Off" },
>   { "IdentityCheck", set_idcheck, NULL, RSRC_CONF|ACCESS_CONF, FLAG, "Enable identd (RFC931)
user lookups - SLOW" },
>   { "ContentDigest", set_content_md5, NULL, RSRC_CONF|ACCESS_CONF|OR_AUTHCFG, FLAG, "whether
or not to send a Content-MD5 header with each request" },
>   { "StartServers", set_daemons_to_start, NULL, RSRC_CONF, TAKE1, "Number of child processes
launched at server startup" },
> Index: httpd.h
> ===================================================================
> RCS file: /export/home/cvs/apache/src/httpd.h,v
> retrieving revision 1.79
> diff -c -r1.79 httpd.h
> *** httpd.h	1997/01/07 06:18:12	1.79
> --- httpd.h	1997/01/25 19:51:16
> ***************
> *** 187,193 ****
>   #define DEFAULT_KEEPALIVE_TIMEOUT 15
>   
>   /* The number of requests to entertain per connection */
> ! #define DEFAULT_KEEPALIVE 5
>   
>   /* The size of the server's internal read-write buffers */
>   #define IOBUFSIZE 8192
> --- 187,193 ----
>   #define DEFAULT_KEEPALIVE_TIMEOUT 15
>   
>   /* The number of requests to entertain per connection */
> ! #define DEFAULT_KEEPALIVE 100
>   
>   /* The size of the server's internal read-write buffers */
>   #define IOBUFSIZE 8192
> 
> 
> -- 
> ________________________________________________________________________
> Alexei Kosut <akosut@nueva.pvt.k12.ca.us>      The Apache HTTP Server
> URL: http://www.nueva.pvt.k12.ca.us/~akosut/   http://www.apache.org/
> 



Mime
View raw message