--------------------- PatchSet 11561 Date: 2007/08/13 03:10:53 Author: hno Branch: HEAD Tag: (none) Log: Check timeouts at a steady 1 second interval even when there is not much activity this is needed to keep delay pools flowing in an even rate. Members: src/comm_generic.c:1.8->1.9 Index: squid/src/comm_generic.c =================================================================== RCS file: /cvsroot/squid/squid/src/comm_generic.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- squid/src/comm_generic.c 31 Oct 2006 18:25:15 -0000 1.8 +++ squid/src/comm_generic.c 13 Aug 2007 03:10:53 -0000 1.9 @@ -1,6 +1,6 @@ /* - * $Id: comm_generic.c,v 1.8 2006/10/31 18:25:15 serassio Exp $ + * $Id: comm_generic.c,v 1.9 2007/08/13 03:10:53 hno Exp $ * * DEBUG: section 5 Socket Functions * @@ -356,7 +356,7 @@ int comm_select(int msec) { - static time_t last_timeout = 0; + static double last_timeout = 0.0; int rc; double start = current_dtime; @@ -377,9 +377,13 @@ storeDirCallback(); /* Check timeouts once per second */ - if (last_timeout != squid_curtime) { - last_timeout = squid_curtime; + if (last_timeout + 0.999 < current_dtime) { + last_timeout = current_dtime; checkTimeouts(); + } else { + int max_timeout = (last_timeout + 1.0 - current_dtime) * 1000; + if (max_timeout < msec) + msec = max_timeout; } comm_select_handled = 0;