Description
In Http1ClientSession we find the following code:
void Http1ClientTransaction::transaction_done() { current_reader = NULL; // If the parent session is not in the closed state, the destroy will not occur. if (parent) { parent->destroy(); } }
the model, as I understand it, is that sessions own transactions, so it is quite unexpected for the transaction to reach up an kill its parent. It is a very surprising side-effect of transaction_done and means that this can only be reliably used in the specific context of the calling code.
Additionally, why isn't the parent cleared in destroy()? If it must be NULL, we should have an assertion.