2.5 and delay pools

From: Adrian Chadd <adrian@dont-contact.us>
Date: Wed, 3 Mar 2004 23:33:07 -0700

hi,

I'm still having issues with squid-2.5 and delay pools.
The FDSET stuff is _very_ broken when you're using >1024 fds.
Here is a simple patch to 2.5 only which removes the whole
fdset thing.

I'd like to commit this so the delay pools stuff in 2.5
works for >1024 fds without _lots_ of messing about.
Can I please have someone comment?

Thanks!

Adrian

styx:/usr/local/src/squid-2/squid-2.5/src# cvs -z9 diff -u delay_pools.c
Index: delay_pools.c
===================================================================
RCS file: /squid/squid/src/delay_pools.c,v
retrieving revision 1.19.2.8
diff -u -r1.19.2.8 delay_pools.c
--- delay_pools.c 18 Jun 2003 23:53:35 -0000 1.19.2.8
+++ delay_pools.c 4 Mar 2004 06:31:44 -0000
@@ -89,7 +89,7 @@
 typedef union _delayPool delayPool;

 static delayPool *delay_data = NULL;
-static fd_set delay_no_delay;
+static int delay_no_delay[SQUID_MAXFD];
 static time_t delay_pools_last_update = 0;
 static hash_table *delay_id_ptr_hash = NULL;
 static long memory_used = 0;
@@ -134,7 +134,7 @@
 delayPoolsInit(void)
 {
     delay_pools_last_update = getCurrentTime();
- FD_ZERO(&delay_no_delay);
+ bzero(&delay_no_delay, sizeof(delay_no_delay));
     cachemgrRegister("delay", "Delay Pool Levels", delayPoolStats, 0, 1);
 }

@@ -283,19 +283,19 @@
 void
 delaySetNoDelay(int fd)
 {
- FD_SET(fd, &delay_no_delay);
+ delay_no_delay[fd] = 1;
 }

 void
 delayClearNoDelay(int fd)
 {
- FD_CLR(fd, &delay_no_delay);
+ delay_no_delay[fd] = 0;
 }

 int
 delayIsNoDelay(int fd)
 {
- return FD_ISSET(fd, &delay_no_delay);
+ return (delay_no_delay[fd] == 1);
 }

 static delay_id
Received on Wed Mar 03 2004 - 23:33:08 MST

This archive was generated by hypermail pre-2.1.9 : Thu Apr 01 2004 - 12:00:04 MST