Skip to content
Snippets Groups Projects
Commit fef0d981 authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

extmod/modlwip: lwip_tcp_receive(): Properly handle EOF for non-blocking sock.

parent f30b6f0a
Branches
No related tags found
No related merge requests found
...@@ -451,6 +451,9 @@ STATIC mp_uint_t lwip_tcp_receive(lwip_socket_obj_t *socket, byte *buf, mp_uint_ ...@@ -451,6 +451,9 @@ STATIC mp_uint_t lwip_tcp_receive(lwip_socket_obj_t *socket, byte *buf, mp_uint_
// Non-blocking socket // Non-blocking socket
if (socket->timeout == 0) { if (socket->timeout == 0) {
if (socket->state == STATE_PEER_CLOSED) {
return 0;
}
*_errno = EAGAIN; *_errno = EAGAIN;
return -1; return -1;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment