httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject Re: [PATCH] buff.c bug fix
Date Sat, 25 Jan 1997 20:05:09 GMT
On Sat, 25 Jan 1997, Alexei Kosut wrote:
> 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.

I'll +1 it with the following minor tweak that deals with out of order
"KeepAlive" and "MaxKeepAliveRequests".

Dean

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 if( cmd->server->keep_alive == 0 )
+ 	/* 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



Mime
View raw message