Mailing List Archive

2 new patches
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;
Re: 2 new patches [ In reply to ]
>+ #ifdef BSD
>+ #include <sys/resource.h>
>+ #endif

Does that conflict with the no_bsd_conf changes?

.....Roy
Re: 2 new patches [ In reply to ]
> >+ #ifdef BSD
> >+ #include <sys/resource.h>
> >+ #endif
>
> Does that conflict with the no_bsd_conf changes?
>
> .....Roy

Can't imagine why it would. It *may* require the no_bsd_conf
patch for systems that don't automagically include <sys/param.h>

This may be a case that we want to later have a HAS_SETRLIMIT
define. It won't break my heart if this patch does not get
included in this round. I am mainly interested in feedback
about it's approach to the problem. It does work on systems
that have setrlimit() and would fix the problem at sites
that encounter a rather low maxopen configuration with lots of
virtual hosts.

Just to clear up any confusion about the BSD define issue, the
changes to conf.h to remove #define BSD are to allow the
system includes to define it if valid and not to override it
in our own includes.