Skip to content

Commit 58901e5

Browse files
authored
Merge pull request #7699 from dhalbert/8.0.x-7694-backport
8.0.x backport: Fix for issue #7054 by avoiding recursive calls to websocket_background.
2 parents bd88992 + a2cb953 commit 58901e5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

supervisor/shared/web_workflow/websocket.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ typedef struct {
5252
// interrupt character.
5353
STATIC ringbuf_t _incoming_ringbuf;
5454
STATIC uint8_t _buf[16];
55+
// make sure background is not called recursively
56+
STATIC bool in_web_background = false;
5557

5658
static _websocket cp_serial;
5759

@@ -244,6 +246,10 @@ void websocket_background(void) {
244246
if (!websocket_connected()) {
245247
return;
246248
}
249+
if (in_web_background) {
250+
return;
251+
}
252+
in_web_background = true;
247253
uint8_t c;
248254
while (ringbuf_num_empty(&_incoming_ringbuf) > 0 &&
249255
_read_next_payload_byte(&c)) {
@@ -253,4 +259,5 @@ void websocket_background(void) {
253259
}
254260
ringbuf_put(&_incoming_ringbuf, c);
255261
}
262+
in_web_background = false;
256263
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy