From cf8c1aa860e05e696f9829e3b031a22ca82781ef Mon Sep 17 00:00:00 2001 From: rubidium42 Date: Tue, 27 Apr 2021 12:13:06 +0200 Subject: Change: [Network] Use string error messages instead of numeric error numbers that need to be looked up --- src/network/core/tcp.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/network/core/tcp.cpp') diff --git a/src/network/core/tcp.cpp b/src/network/core/tcp.cpp index b9ba33f00..f23b202c8 100644 --- a/src/network/core/tcp.cpp +++ b/src/network/core/tcp.cpp @@ -90,7 +90,7 @@ SendPacketsState NetworkTCPSocketHandler::SendPackets(bool closing_down) if (err != EWOULDBLOCK) { /* Something went wrong.. close client! */ if (!closing_down) { - DEBUG(net, 0, "send failed with error %d", err); + DEBUG(net, 0, "send failed with error %s", NetworkGetErrorString(err)); this->CloseConnection(); } return SPS_CLOSED; @@ -138,8 +138,8 @@ Packet *NetworkTCPSocketHandler::ReceivePacket() if (res == -1) { int err = NetworkGetLastError(); if (err != EWOULDBLOCK) { - /* Something went wrong... (104 is connection reset by peer) */ - if (err != 104) DEBUG(net, 0, "recv failed with error %d", err); + /* Something went wrong... (ECONNRESET is connection reset by peer) */ + if (err != ECONNRESET) DEBUG(net, 0, "recv failed with error %s", NetworkGetErrorString(err)); this->CloseConnection(); return nullptr; } @@ -166,8 +166,8 @@ Packet *NetworkTCPSocketHandler::ReceivePacket() if (res == -1) { int err = NetworkGetLastError(); if (err != EWOULDBLOCK) { - /* Something went wrong... (104 is connection reset by peer) */ - if (err != 104) DEBUG(net, 0, "recv failed with error %d", err); + /* Something went wrong... (ECONNRESET is connection reset by peer) */ + if (err != ECONNRESET) DEBUG(net, 0, "recv failed with error %s", NetworkGetErrorString(err)); this->CloseConnection(); return nullptr; } -- cgit v1.2.3-70-g09d2