zephyr/modsocket: Don't consult uip_connr flags when deciding conn state.
The fact that *now* connection closed doesn't mean there's no data in the queue. We should process packet queue in order, and consider connection closed only when hit corresponding state change packet (the latter requires patches to Zephyr, because otherwise it doesn't deliver connection state change packets to an app).zephyr-rebase
parent
5269f23b2c
commit
718b896f48
|
@ -205,7 +205,7 @@ STATIC mp_uint_t socket_read(mp_obj_t self_in, void *buf, mp_uint_t len, int *er
|
|||
DEBUG_printf("socket_read(%p, %p, %d) conn_flags: %x\n", self_in, buf, len, uip_connr->tcpstateflags);
|
||||
|
||||
while (self->incoming == NULL) {
|
||||
if (self->state == STATE_PEER_CLOSED || uip_connr->tcpstateflags == UIP_CLOSED) {
|
||||
if (self->state == STATE_PEER_CLOSED /*|| uip_connr->tcpstateflags == UIP_CLOSED*/) {
|
||||
DEBUG_printf("socket_read: Returning EOF\n");
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue