Skip to content

Commit

Permalink
raw-skt: don't read more than rx_buffer_size
Browse files Browse the repository at this point in the history
When other roles like ws reading data, they follow `rx_buffer_size`, then fallback to context's `pt_serv_buf_size`.
However, `raw-skt` don't follow `rx_buffer_size`, always use 0, then fallback to `pt_serv_buf_size`.

This PR make `raw-skt` don't read more than `rx_buffer_size` data.
  • Loading branch information
liudongmiao authored and lws-team committed Mar 7, 2024
1 parent e38e85e commit 992f40c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/roles/raw-skt/ops-raw-skt.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ rops_handle_POLLIN_raw_skt(struct lws_context_per_thread *pt, struct lws *wsi,
#endif
default:
ebuf.token = NULL;
ebuf.len = 0;
ebuf.len = (int) wsi->a.protocol->rx_buffer_size;

buffered = lws_buflist_aware_read(pt, wsi, &ebuf, 1, __func__);
switch (ebuf.len) {
Expand Down

0 comments on commit 992f40c

Please sign in to comment.