From: wessels <> Date: Tue, 9 May 2006 01:57:30 +0000 (+0000) Subject: bugfix: Diskd has a loop that puts Squid to sleep for small amounts of X-Git-Tag: SQUID_3_0_PRE4~174 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9a518127b510f13aa244e2a73e1af9e63e6994c5;p=thirdparty%2Fsquid.git bugfix: Diskd has a loop that puts Squid to sleep for small amounts of time when the queues size reach a threshhold. The time-to-sleep is supposed to double each time through the loop, but struct timeval delay was initialized inside the loop, rather than outside, which meant it always slept for 1 microsecond. --- diff --git a/src/DiskIO/DiskDaemon/DiskdIOStrategy.cc b/src/DiskIO/DiskDaemon/DiskdIOStrategy.cc index 799f394907..6986c2d89b 100644 --- a/src/DiskIO/DiskDaemon/DiskdIOStrategy.cc +++ b/src/DiskIO/DiskDaemon/DiskdIOStrategy.cc @@ -1,6 +1,6 @@ /* - * $Id: DiskdIOStrategy.cc,v 1.2 2005/01/03 16:08:26 robertc Exp $ + * $Id: DiskdIOStrategy.cc,v 1.3 2006/05/08 19:57:30 wessels Exp $ * * DEBUG: section 79 Squid-side DISKD I/O functions. * AUTHOR: Duane Wessels @@ -402,10 +402,10 @@ DiskdIOStrategy::send(int mtype, int id, DiskdFile *theFile, int size, int offse * we're "blocking" on this SD we can also handle callbacks * from other SDs that might be ready. */ - while (away > magic2) { - struct timeval delay = {0, 1}; + struct timeval delay = {0, 1}; + while (away > magic2) { select(0, NULL, NULL, NULL, &delay); Store::Root().callback(); @@ -461,10 +461,10 @@ DiskdIOStrategy::send(int mtype, int id, StoreIOState::Pointer sio, int size, in * we're "blocking" on this SD we can also handle callbacks * from other SDs that might be ready. */ - while (away > magic2) { - struct timeval delay = {0, 1}; + struct timeval delay = {0, 1}; + while (away > magic2) { select(0, NULL, NULL, NULL, &delay); Store::Root().callback();