Skip to content

Commit 59a4fee

Browse files
committed
extmod/modwebsocket: Another case to propagate EOF.
1 parent 733db52 commit 59a4fee

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

extmod/modwebsocket.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ STATIC mp_uint_t websocket_read(mp_obj_t self_in, void *buf, mp_uint_t size, int
155155
case PAYLOAD: {
156156
size_t sz = MIN(size, self->msg_sz);
157157
mp_uint_t out_sz = stream_p->read(self->sock, buf, sz, errcode);
158-
if (out_sz == MP_STREAM_ERROR) {
158+
if (out_sz == 0 || out_sz == MP_STREAM_ERROR) {
159159
return out_sz;
160160
}
161161

0 commit comments

Comments
 (0)