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:
Max Kellermann
2019-08-22 09:07:41 +02:00
parent e6600b8562
commit f2cdbeace6
7 changed files with 49 additions and 8 deletions
+5
View File
@@ -69,5 +69,10 @@ Client::OnSocketInput(void *data, size_t length) noexcept
return InputResult::CLOSED;
}
if (IsExpired()) {
Close();
return InputResult::CLOSED;
}
return InputResult::AGAIN;
}