]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
bugfix: Diskd has a loop that puts Squid to sleep for small amounts of
authorwessels <>
Tue, 9 May 2006 01:57:30 +0000 (01:57 +0000)
committerwessels <>
Tue, 9 May 2006 01:57:30 +0000 (01:57 +0000)
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.

src/DiskIO/DiskDaemon/DiskdIOStrategy.cc

index 799f3949072e01e82b3cbeaf0d9e071bbf3d692e..6986c2d89b4d36c01f9b69dcaf63729b43e53139 100644 (file)
@@ -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();