extmod/modusocket: Fix polling of a new socket.

New sockets should return HUP and WR when polled, following modlwip.
pull/8698/head
iabdalkader 2022-05-12 12:58:45 +02:00 zatwierdzone przez Damien George
rodzic 79f3b8731b
commit 7b4147dd0b
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -451,7 +451,8 @@ mp_uint_t socket_ioctl(mp_obj_t self_in, mp_uint_t request, uintptr_t arg, int *
}
if (self->nic == MP_OBJ_NULL) {
if (request == MP_STREAM_POLL) {
return MP_STREAM_POLL_NVAL;
// New sockets are writable and not connected.
return MP_STREAM_POLL_HUP | MP_STREAM_POLL_WR;
}
*errcode = MP_EINVAL;
return MP_STREAM_ERROR;