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
Paul Sokolovsky 2016-09-20 20:12:11 +03:00
parent 5269f23b2c
commit 718b896f48
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}