mirror of
https://github.com/lunarmodules/luasocket.git
synced 2024-12-25 20:18:21 +01:00
fix(wsocket): Properly report CONNRESET (#81)
This commit is contained in:
parent
bef62aeb50
commit
22b8202d70
@ -262,6 +262,7 @@ int socket_recv(p_socket ps, char *data, size_t count, size_t *got,
|
|||||||
if (err != WSAEWOULDBLOCK) {
|
if (err != WSAEWOULDBLOCK) {
|
||||||
if (err != WSAECONNRESET || prev == WSAECONNRESET) return err;
|
if (err != WSAECONNRESET || prev == WSAECONNRESET) return err;
|
||||||
prev = err;
|
prev = err;
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
if ((err = socket_waitfd(ps, WAITFD_R, tm)) != IO_DONE) return err;
|
if ((err = socket_waitfd(ps, WAITFD_R, tm)) != IO_DONE) return err;
|
||||||
}
|
}
|
||||||
@ -291,6 +292,7 @@ int socket_recvfrom(p_socket ps, char *data, size_t count, size_t *got,
|
|||||||
if (err != WSAEWOULDBLOCK) {
|
if (err != WSAEWOULDBLOCK) {
|
||||||
if (err != WSAECONNRESET || prev == WSAECONNRESET) return err;
|
if (err != WSAECONNRESET || prev == WSAECONNRESET) return err;
|
||||||
prev = err;
|
prev = err;
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
if ((err = socket_waitfd(ps, WAITFD_R, tm)) != IO_DONE) return err;
|
if ((err = socket_waitfd(ps, WAITFD_R, tm)) != IO_DONE) return err;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user