Skip to content

Commit fef0d98

Browse files
committed
extmod/modlwip: lwip_tcp_receive(): Properly handle EOF for non-blocking sock.
1 parent f30b6f0 commit fef0d98

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

extmod/modlwip.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,9 @@ STATIC mp_uint_t lwip_tcp_receive(lwip_socket_obj_t *socket, byte *buf, mp_uint_
451451

452452
// Non-blocking socket
453453
if (socket->timeout == 0) {
454+
if (socket->state == STATE_PEER_CLOSED) {
455+
return 0;
456+
}
454457
*_errno = EAGAIN;
455458
return -1;
456459
}

0 commit comments

Comments
 (0)