Skip to content

Commit 9e9367b

Browse files
yjq91115lws-team
authored andcommitted
ops-ws: reported spinning under some conditions
Fixed the issue where pending has data and buflist has data, which would cause an infinite loop and disconnect the connection. Signed-off-by: yangjianqing <yangjianqing@xiaomi.com>
1 parent 2095b20 commit 9e9367b

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

lib/roles/ws/ops-ws.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,6 +1228,9 @@ rops_handle_POLLIN_ws(struct lws_context_per_thread *pt, struct lws *wsi,
12281228

12291229
pending = (unsigned int)lws_ssl_pending(wsi);
12301230

1231+
if (!pending && lws_buflist_next_segment_len(&wsi->buflist, NULL))
1232+
return LWS_HPI_RET_HANDLED;
1233+
12311234
#if defined(LWS_WITH_CLIENT)
12321235
if (!pending && (wsi->flags & LCCSCF_PRIORITIZE_READS) &&
12331236
lws_buflist_total_len(&wsi->buflist))

0 commit comments

Comments
 (0)