Core/Networking: Fixed unsafe access to _worldSession member in WorldSocket
(cherry picked from commit bed88e0dd475af5b73cea03821f7fb7cb9ddce9d) Core/Networking: Fixed deadlock in HandlePing if the client is about to be kicked for overspeed pings (cherry picked from commit 3da0f7e40920b652d2222fa88dbb4b516d24725d) Core/Networking: Cleanup CloseSocket calls from read failures in WorldSocket (cherry picked from commit 18343a7309fbf53a3509749c0a5ca1f8ea273c57) Conflicts: src/server/game/Server/WorldSocket.cpp Ref #14474
This commit is contained in:
1 parent
0df5cb972d
commit
548aa119ac
4 files changed
+85
-41
No files matched your search
@@ -62,7 +62,7 @@ public:
|
||||
return false;
|
||||
|
||||
#ifndef TC_SOCKET_USE_IOCP
|
||||
std::unique_lock<std::mutex> guard(_writeLock, std::try_to_lock);
|
||||
std::unique_lock<std::mutex> guard(_writeLock);
|
||||
if (!guard)
|
||||
return true;
|
||||
|
||||
@@ -140,6 +140,8 @@ public:
|
||||
if (shutdownError)
|
||||
TC_LOG_DEBUG("network", "Socket::CloseSocket: %s errored when shutting down socket: %i (%s)", GetRemoteIpAddress().to_string().c_str(),
|
||||
shutdownError.value(), shutdownError.message().c_str());
|
||||
|
||||
OnClose();
|
||||
}
|
||||
|
||||
/// Marks the socket for closing after write buffer becomes empty
|
||||
@@ -148,6 +150,8 @@ public:
|
||||
MessageBuffer& GetReadBuffer() { return _readBuffer; }
|
||||
|
||||
protected:
|
||||
virtual void OnClose() { }
|
||||
|
||||
virtual void ReadHandler() = 0;
|
||||
|
||||
bool AsyncProcessQueue(std::unique_lock<std::mutex>&)
|
||||
|
||||
Reference in new issue
Block a user