httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy Terbush <ra...@zyzzyva.com>
Subject 2 new patches
Date Sun, 03 Sep 1995 04:47:59 GMT

I've just uploaded a couple of patches to for_Apache_0.8.12.

The first is a *bug fix* to mod_log_config.c which adds a tag
to allow logging of the time format in integer.millisecond
format.  I chose the %T tag to configure this. Suggestions welcome
for alternatives.

The second patch I will include in this email since it is not
very portable, and perhaps controversial. (my forte) :-)
This should address the issue of running up against the 
maxopen file limit with virtual host entries. I am not aware
if SysV machines have setrlimit(). I suppose ulimit() might
be the alternative. Anyway, I am curious if anyone agrees 
with where I chose to put this. Feedback welcome.

These patches are on hyperreal as:

15_log_config_integer_time.0.8.12.patch
16_virtual_maxopenfiles.0.8.12.patch



*** http_config.c.orig	Sat Sep  2 21:54:10 1995
--- http_config.c	Sat Sep  2 22:27:51 1995
***************
*** 83,88 ****
--- 83,92 ----
  #include "http_request.h"	/* for default_handler (see invoke_handler) */
  #include "http_conf_globals.h"	/* Sigh... */
  
+ #ifdef BSD
+ #include <sys/resource.h>
+ #endif
+ 
  /****************************************************************
   *
   * We begin with the functions which deal with the linked list
***************
*** 621,626 ****
--- 625,641 ----
  server_rec *init_virtual_host (pool *p, char *hostname)
  {
      server_rec *s = (server_rec *)pcalloc (p, sizeof (server_rec));
+ 
+ #ifdef BSD
+     struct rlimit limits;
+ 
+     getrlimit ( RLIMIT_NOFILE, &limits );
+     if ( limits.rlim_cur < limits.rlim_max ) {
+       limits.rlim_cur += 2;
+       if ( setrlimit ( RLIMIT_NOFILE, &limits ) < 0 )
+ 	fprintf (stderr, "Cannot exceed hard limit for open files");
+     }
+ #endif
  
      s->port = 0;
      s->server_admin = NULL;




Mime
View raw message