diff options
author | rubidium42 <rubidium@openttd.org> | 2021-04-27 10:50:28 +0200 |
---|---|---|
committer | Charles Pigott <charlespigott@googlemail.com> | 2021-04-27 18:17:34 +0100 |
commit | 65c5a647191a9a10a532bb9d67da6938f5eace1b (patch) | |
tree | 0a2444886e56ad63583dae0e4e8f5a632a63199d /src/network/core/tcp.cpp | |
parent | a934dfe0be9621b784ccd1dca81d2ef8214fc4e0 (diff) | |
download | openttd-65c5a647191a9a10a532bb9d67da6938f5eace1b.tar.xz |
Fix: [Network] errno and strerror do not handle network errors on Windows
Diffstat (limited to 'src/network/core/tcp.cpp')
-rw-r--r-- | src/network/core/tcp.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/network/core/tcp.cpp b/src/network/core/tcp.cpp index 72e66a0b5..b9ba33f00 100644 --- a/src/network/core/tcp.cpp +++ b/src/network/core/tcp.cpp @@ -86,7 +86,7 @@ SendPacketsState NetworkTCPSocketHandler::SendPackets(bool closing_down) while ((p = this->packet_queue) != nullptr) { res = p->TransferOut<int>(send, this->sock, 0); if (res == -1) { - int err = GET_LAST_ERROR(); + int err = NetworkGetLastError(); if (err != EWOULDBLOCK) { /* Something went wrong.. close client! */ if (!closing_down) { @@ -136,7 +136,7 @@ Packet *NetworkTCPSocketHandler::ReceivePacket() while (p->RemainingBytesToTransfer() != 0) { res = p->TransferIn<int>(recv, this->sock, 0); if (res == -1) { - int err = GET_LAST_ERROR(); + 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); @@ -164,7 +164,7 @@ Packet *NetworkTCPSocketHandler::ReceivePacket() while (p->RemainingBytesToTransfer() != 0) { res = p->TransferIn<int>(recv, this->sock, 0); if (res == -1) { - int err = GET_LAST_ERROR(); + 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); |