Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions telnetd.c
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,14 @@ void telnet_stream_handler (sessiondata_t *session)

void telnetd_poll (void)
{
static bool in_poll = false;

if(in_poll)
return; // Prevent reentrancy from stream_tx_blocking callback

in_poll = true;
telnet_stream_handler(&streamSession);
in_poll = false;
}

// Deprecated - remove
Expand Down
9 changes: 9 additions & 0 deletions websocketd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1368,6 +1368,13 @@ static void websocket_stream_handler (ws_sessiondata_t *session)
//
void websocketd_poll (void)
{
static bool in_poll = false;

if(in_poll)
return; // Prevent reentrancy from stream_tx_blocking callback

in_poll = true;

ws_sessiondata_t *client;
uint_fast16_t idx = WEBUI_MAX_CLIENTS;

Expand All @@ -1380,6 +1387,8 @@ void websocketd_poll (void)
} else if(client->state == WsState_Closing)
websocket_close_conn(client, client->pcb);
} while(idx);

in_poll = false;
}

void websocketd_notify_link_status (bool up)
Expand Down