From: robertc <> Date: Thu, 15 May 2003 13:06:24 +0000 (+0000) Subject: Summary: Delayed reads could get lost if they where assigned to a DelayVector. X-Git-Tag: SQUID_3_0_PRE1~192 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2e6c0f0fc68e4d43a31619ed89432750c2587560;p=thirdparty%2Fsquid.git Summary: Delayed reads could get lost if they where assigned to a DelayVector. Keywords: Delayed reads could get lost if they where assigned to a DelayVector. --- diff --git a/src/DelayVector.cc b/src/DelayVector.cc index 882d88a4de..0d48b6c078 100644 --- a/src/DelayVector.cc +++ b/src/DelayVector.cc @@ -1,6 +1,6 @@ /* - * $Id: DelayVector.cc,v 1.5 2003/03/10 20:12:43 robertc Exp $ + * $Id: DelayVector.cc,v 1.6 2003/05/15 07:06:24 robertc Exp $ * * DEBUG: section 77 Delay Pools * AUTHOR: Robert Collins @@ -64,8 +64,15 @@ DelayVector::deleteSelf() const delete this; } +DelayVector::DelayVector() +{ + DelayPools::RegisterForUpdates (this); +} + DelayVector::~DelayVector() -{} +{ + DelayPools::DeregisterForUpdates (this); +} void DelayVector::stats(StoreEntry * sentry) @@ -92,12 +99,10 @@ DelayVector::dump(StoreEntry *entry) const void DelayVector::update(int incr) { - iterator pos = pools.begin(); - - while (pos != pools.end()) { - (*pos)->update(incr); - ++pos; - } + /* + * Each pool updates itself, + * but we may have deferred reads waiting on the pool as a whole. + */ kickReads(); } diff --git a/src/DelayVector.h b/src/DelayVector.h index 5dc21a84c2..d6d96c1665 100644 --- a/src/DelayVector.h +++ b/src/DelayVector.h @@ -1,6 +1,6 @@ /* - * $Id: DelayVector.h,v 1.5 2003/03/06 11:51:55 robertc Exp $ + * $Id: DelayVector.h,v 1.6 2003/05/15 07:06:24 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -46,6 +46,7 @@ public: void *operator new(size_t); void operator delete (void *); virtual void deleteSelf() const; + DelayVector(); virtual ~DelayVector(); virtual void stats(StoreEntry * sentry); virtual void dump(StoreEntry *entry) const;