From: Christos Tsantilas Date: Thu, 8 Sep 2016 10:25:37 +0000 (+0300) Subject: Squid crashes on shutdown while cleaning up idle ICAP connections, part2 X-Git-Tag: SQUID_4_0_14~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=af8341482f3c91ca26b7ecbe8902fa1df261fbf0;p=thirdparty%2Fsquid.git Squid crashes on shutdown while cleaning up idle ICAP connections, part2 Fixes to allow make check work: - Fix tests/stub_pconn.cc to correctly implement a stub IdleConnList - Replace reinterpret_cast with static_cast to avoid errors when clang is used. The IdleConnList is now a hash_link kid and static_cast is the correct one. --- diff --git a/src/pconn.cc b/src/pconn.cc index a038cec5b6..2cb8415d94 100644 --- a/src/pconn.cc +++ b/src/pconn.cc @@ -392,7 +392,7 @@ PconnPool::PconnPool(const char *aDescr, const CbcPointer &aMgr): static void DeleteIdleConnList(void *hashItem) { - delete reinterpret_cast(hashItem); + delete static_cast(hashItem); } PconnPool::~PconnPool() @@ -491,7 +491,7 @@ PconnPool::closeN(int n) } // may delete current - reinterpret_cast(current)->closeN(1); + static_cast(current)->closeN(1); } } diff --git a/src/tests/stub_pconn.cc b/src/tests/stub_pconn.cc index 4ab709049a..352876d159 100644 --- a/src/tests/stub_pconn.cc +++ b/src/tests/stub_pconn.cc @@ -16,11 +16,12 @@ #define STUB_API "pconn.cc" #include "tests/STUB.h" -IdleConnList::IdleConnList(const char *key, PconnPool *parent) STUB +IdleConnList::IdleConnList(const char *akey, PconnPool *parent) STUB IdleConnList::~IdleConnList() STUB void IdleConnList::push(const Comm::ConnectionPointer &conn) STUB -Comm::ConnectionPointer IdleConnList::findUseable(const Comm::ConnectionPointer &key) STUB_RETVAL(Comm::ConnectionPointer()) +Comm::ConnectionPointer IdleConnList::findUseable(const Comm::ConnectionPointer &akey) STUB_RETVAL(Comm::ConnectionPointer()) void IdleConnList::clearHandlers(const Comm::ConnectionPointer &conn) STUB +void IdleConnList::endingShutdown() STUB PconnPool::PconnPool(const char *, const CbcPointer&) STUB PconnPool::~PconnPool() STUB void PconnPool::moduleInit() STUB