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:
@@ -21,6 +21,13 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
bool
|
||||
Client::Write(const void *data, size_t length) noexcept
|
||||
{
|
||||
/* if the client is going to be closed, do nothing */
|
||||
return !IsExpired() && FullyBufferedSocket::Write(data, length);
|
||||
}
|
||||
|
||||
bool
|
||||
Client::Write(const char *data) noexcept
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user