mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Networking: Fixed DelayedCloseSocket when compiled without TC_SOCKET_USE_IOCP (linux)
Closes #16769
This commit is contained in:
@@ -55,11 +55,11 @@ public:
|
||||
|
||||
virtual bool Update()
|
||||
{
|
||||
if (!IsOpen())
|
||||
if (_closed)
|
||||
return false;
|
||||
|
||||
#ifndef TC_SOCKET_USE_IOCP
|
||||
if (_isWritingAsync || _writeQueue.empty())
|
||||
if (_isWritingAsync || (_writeQueue.empty() && !_closing))
|
||||
return true;
|
||||
|
||||
for (; HandleQueue();)
|
||||
@@ -164,7 +164,6 @@ protected:
|
||||
GetRemoteIpAddress().to_string().c_str(), err.value(), err.message().c_str());
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
void ReadHandlerInternal(boost::system::error_code error, size_t transferredBytes)
|
||||
{
|
||||
@@ -208,9 +207,6 @@ private:
|
||||
|
||||
bool HandleQueue()
|
||||
{
|
||||
if (!IsOpen())
|
||||
return false;
|
||||
|
||||
if (_writeQueue.empty())
|
||||
return false;
|
||||
|
||||
@@ -227,11 +223,15 @@ private:
|
||||
return AsyncProcessQueue();
|
||||
|
||||
_writeQueue.pop();
|
||||
if (_closing && _writeQueue.empty())
|
||||
CloseSocket();
|
||||
return false;
|
||||
}
|
||||
else if (bytesSent == 0)
|
||||
{
|
||||
_writeQueue.pop();
|
||||
if (_closing && _writeQueue.empty())
|
||||
CloseSocket();
|
||||
return false;
|
||||
}
|
||||
else if (bytesSent < bytesToSend) // now n > 0
|
||||
@@ -241,6 +241,8 @@ private:
|
||||
}
|
||||
|
||||
_writeQueue.pop();
|
||||
if (_closing && _writeQueue.empty())
|
||||
CloseSocket();
|
||||
return !_writeQueue.empty();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user