1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-16 00:00:07 +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:
TerryZhang 2020-03-04 12:51:47 +00:00 committed by Andy Green
parent 3a4698e63a
commit 5eaab80708

View file

@ -170,6 +170,11 @@ int 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 */