SQUID_MAXFD

From: Miquel van Smoorenburg <miquels@dont-contact.us>
Date: Mon, 9 Dec 1996 18:05:24 +0100 (MET)

I've just compiled and install squid-1.1.0 on our Linux proxy cache. It
works fine, but it thinks the number of file descriptors it can open is
1024 which it isn't, as I run an unpatched kernel it's 256.

This piece of code from squid.h causes problems:

#if FD_SETSIZE < SQUID_MAXFD
#undef SQUID_MAXFD
#define SQUID_MAXFD FD_SETSIZE
#endif

It's used before any other file is included so FD_SETSIZE is not defined
eg 0, and this is _always_ true. Now on Linux FD_SETSIZE is 1024
but the maximum no. of file descriptor per process is 256.

I think the safest solution would be to make squid_maxfd a variable
instead of a constant, initialized as squid_maxfd = SQUID_MAXFD in main().
Then when we much around with getrlimit() and setrlimit() in tools.c
we can set squid_maxfd to the real kernel maximum.

I'll create some patches to squid-1.1.0 later this week if noone has
done that yet.

Mike.

-- 
   Miquel van      | Cistron Internet Services   --    Alphen aan den Rijn.
   Smoorenburg,    | mailto:info@cistron.nl          http://www.cistron.nl/
miquels@cistron.nl | Our vision is to speed up time, eventually eliminating it.
Received on Mon Dec 09 1996 - 09:16:13 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:33:50 MST