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:
@@ -122,9 +122,15 @@ public:
|
||||
|
||||
using FullyBufferedSocket::GetEventLoop;
|
||||
|
||||
void Close() noexcept;
|
||||
gcc_pure
|
||||
bool IsExpired() const noexcept {
|
||||
return !FullyBufferedSocket::IsDefined();
|
||||
}
|
||||
|
||||
using FullyBufferedSocket::Write;
|
||||
void Close() noexcept;
|
||||
void SetExpired() noexcept;
|
||||
|
||||
bool Write(const void *data, size_t length) noexcept;
|
||||
|
||||
/**
|
||||
* Write a null-terminated string.
|
||||
|
Reference in New Issue
Block a user