Fix: [Network] errno and strerror do not handle network errors on Windows
This commit is contained in:
committed by
Charles Pigott
parent
a934dfe0be
commit
65c5a64719
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user