]> git.ipfire.org Git - thirdparty/squid.git/commit - src/pconn.cc
Bug fixes: Multiple bugs in IdleConnList part2
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Thu, 7 Jul 2011 10:13:53 +0000 (13:13 +0300)
committerChristos Tsantilas <chtsanti@users.sourceforge.net>
Thu, 7 Jul 2011 10:13:53 +0000 (13:13 +0300)
commit4eb4fb170ec6262a5ca26976defe586f71cffe25
treed039a1810925f790129c52c219fdc4d4041652f8
parent1d17952a6f7fcbc5a68cb819cb2a16f86e1a6337
Bug fixes: Multiple bugs in IdleConnList part2

commit revno:11534  fixes:
 - Inside IdleConnList::removeAt method the ellements deleted correctly from
   the theList_ array. The problem was that if parent_ exist the size of the
   array is not decreased and the last element was duplicated (the last two
   ellements pointed to the same connection object).
   The commit revno:11534 did not solve this problem and just created a
   duplicate entry in an other position.
   This patch solves the problems in IdleConnList::removeAt method.

Other:
 - Remove the fd_table[fd].flags.read_pending tests inside IdleConnList::pop
   and IdleConnList::findUsable methods. This flag currently is not fully
   implemented and used only by the ssl stuff.

 - Inside IdleConnList::closeN method in two positions we are storing the
   reference of the Comm::Connection object which will be deleted, to use it
   to clean up and close the connection later:
       const Comm::ConnectionPointer &conn = theList_[--size_];
       theList_[size_] = NULL;
   This is wrong because the second command may delete the conn object, causing
   assertion in Comm::Connection destructor, because it is still open, or
   segmentation faults when trying to use the conn object later.
   This patch replaces the pointer reference with a normal pointer.

 - Call clearHandlers inside IdleConnList::pop and IdleConnList::findUsable
   methods before return the Comm::Connection object to the user.
src/pconn.cc