We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b32b0d3 commit 7e9182fCopy full SHA for 7e9182f
1 file changed
extmod/modwebsocket.c
@@ -68,7 +68,7 @@ STATIC mp_uint_t websocket_read(mp_obj_t self_in, void *buf, mp_uint_t size, int
68
while (1) {
69
if (self->to_recv != 0) {
70
mp_uint_t out_sz = stream_p->read(self->sock, self->buf + self->buf_pos, self->to_recv, errcode);
71
- if (out_sz == MP_STREAM_ERROR) {
+ if (out_sz == 0 || out_sz == MP_STREAM_ERROR) {
72
return out_sz;
73
}
74
self->buf_pos += out_sz;
0 commit comments