1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

ws: make sure we understand frame finished when buflist_out flushed

When lws_write as many bytes as user can until function returns not all sent,
the next user`s lws_write call will write wrong frame to the other end. This
will cause connection be close by the other side.
This commit is contained in:
Terry Zhang 2020-03-04 17:39:11 +08:00 committed by Andy Green
parent 0e94683897
commit eb9c01ae5c

View file

@ -172,6 +172,11 @@ lws_issue_raw(struct lws *wsi, unsigned char *buf, size_t len)
-1 : (int)real_len;
}
#endif
#endif
#if defined(LWS_ROLE_WS)
/* Since buflist_out flushed, we're not inside a frame any more */
if (wsi->ws)
wsi->ws->inside_frame = 0;
#endif
}
/* always callback on writeable */