From 59a4fee5161c198f59a4a1f7afe4096d23826ab1 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Wed, 13 Apr 2016 22:14:46 +0300 Subject: [PATCH] extmod/modwebsocket: Another case to propagate EOF. --- extmod/modwebsocket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extmod/modwebsocket.c b/extmod/modwebsocket.c index 78bbe6d13e..bc71442e72 100644 --- a/extmod/modwebsocket.c +++ b/extmod/modwebsocket.c @@ -155,7 +155,7 @@ STATIC mp_uint_t websocket_read(mp_obj_t self_in, void *buf, mp_uint_t size, int case PAYLOAD: { size_t sz = MIN(size, self->msg_sz); mp_uint_t out_sz = stream_p->read(self->sock, buf, sz, errcode); - if (out_sz == MP_STREAM_ERROR) { + if (out_sz == 0 || out_sz == MP_STREAM_ERROR) { return out_sz; }