Revert "Client: eliminate SetExpired(), call Close() directly"
This reverts commit 58d7804d66
. It
caused a use-after-free bug when Client::OnSocketError() was called
due to a failed write, e.g. if the output buffer was full.
This commit is contained in:
@@ -25,11 +25,11 @@ Client::OnSocketError(std::exception_ptr ep) noexcept
|
||||
{
|
||||
FormatError(ep, "error on client %d", num);
|
||||
|
||||
Close();
|
||||
SetExpired();
|
||||
}
|
||||
|
||||
void
|
||||
Client::OnSocketClosed() noexcept
|
||||
{
|
||||
Close();
|
||||
SetExpired();
|
||||
}
|
||||
|
Reference in New Issue
Block a user