extmod/modwebsocket: Make sure to propagate EOF.

This commit is contained in:
Paul Sokolovsky 2016-04-08 20:07:11 +03:00
parent b32b0d38fe
commit 7e9182f3aa

View File

@ -68,7 +68,7 @@ STATIC mp_uint_t websocket_read(mp_obj_t self_in, void *buf, mp_uint_t size, int
while (1) {
if (self->to_recv != 0) {
mp_uint_t out_sz = stream_p->read(self->sock, self->buf + self->buf_pos, self->to_recv, errcode);
if (out_sz == MP_STREAM_ERROR) {
if (out_sz == 0 || out_sz == MP_STREAM_ERROR) {
return out_sz;
}
self->buf_pos += out_sz;