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

pmd: revert #3014 and drain extensions before next ssl read

This commit is contained in:
Lonny Wong 2023-11-22 23:08:07 +08:00 committed by Andy Green
parent 0c1a090273
commit bfa67ecf0c
3 changed files with 13 additions and 4 deletions

View file

@ -723,7 +723,7 @@ utf8_fail:
}
#if !defined(LWS_WITHOUT_EXTENSIONS)
if (!lin && !(already_processed & ALREADY_PROCESSED_FULL_DRAINING))
if (!lin)
break;
#endif
@ -1223,8 +1223,18 @@ drain:
else
pending = pending > wsi->a.context->pt_serv_buf_size ?
wsi->a.context->pt_serv_buf_size : pending;
if (--sanity)
if (--sanity) {
#if !defined(LWS_WITHOUT_EXTENSIONS)
while (wsi->ws->rx_draining_ext) {
// RX Extension needs to be drained before next read
n = lws_ws_rx_sm(wsi, ALREADY_PROCESSED_IGNORE_CHAR, 0);
if (n < 0) {
return LWS_HPI_RET_PLEASE_CLOSE_ME;
}
}
#endif
goto read;
}
else
/*
* Something has gone wrong, we are spinning...

View file

@ -75,7 +75,6 @@ enum lws_websocket_opcodes_07 {
#define ALREADY_PROCESSED_IGNORE_CHAR 1
#define ALREADY_PROCESSED_NO_CB 2
#define ALREADY_PROCESSED_FULL_DRAINING 4
#if !defined(LWS_WITHOUT_EXTENSIONS)
struct lws_vhost_role_ws {

View file

@ -1080,7 +1080,7 @@ lws_parse_ws(struct lws *wsi, unsigned char **buf, size_t len)
wsi->ws->rx_draining_ext);
#endif
m = lws_ws_rx_sm(wsi, ALREADY_PROCESSED_IGNORE_CHAR |
ALREADY_PROCESSED_NO_CB | ALREADY_PROCESSED_FULL_DRAINING, 0);
ALREADY_PROCESSED_NO_CB, 0);
}
if (m < 0) {