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
......@@ -451,6 +451,9 @@ STATIC mp_uint_t lwip_tcp_receive(lwip_socket_obj_t *socket, byte *buf, mp_uint_
// Non-blocking socket
if (socket->timeout == 0) {
if (socket->state == STATE_PEER_CLOSED) {
return 0;
}
*_errno = EAGAIN;
return -1;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment