Fix: [Network] errno and strerror do not handle network errors on Windows

This commit is contained in:
rubidium42
2021-04-27 10:50:28 +02:00
committed by Charles Pigott
parent a934dfe0be
commit 65c5a64719
7 changed files with 54 additions and 18 deletions

View File

@@ -228,7 +228,7 @@ int NetworkHTTPSocketHandler::Receive()
for (;;) {
ssize_t res = recv(this->sock, (char *)this->recv_buffer + this->recv_pos, lengthof(this->recv_buffer) - this->recv_pos, 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);