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.