You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello and thank you for your great work. Because I found also the solution for the bug, hopefully this short description is enough:
I wanted to switch from Websockets to SSE. However, I encountered an issue in release v3.6.2: If I disconnect a client, the esp32s3 crashs in this function:
void AsyncEventSource::_handleDisconnect(AsyncEventSourceClient *client) {
if (_disconnectcb) {
_disconnectcb(client);
}
#ifdef ESP32
std::lock_guard<std::mutex> lock(_client_queue_lock);
#endif
for (auto i = _clients.begin(); i != _clients.end(); ++i) {
if (i->get() == client) {
_clients.erase(i);
}
}
_adjust_inflight_window();
}
Issue and simple fix:
By erasing an element from _clients the iterator becomes "unusable". Therefore it is necessary to break the loop after erase:
void AsyncEventSource::_handleDisconnect(AsyncEventSourceClient *client) {
if (_disconnectcb) {
_disconnectcb(client);
}
#ifdef ESP32
std::lock_guard<std::mutex> lock(_client_queue_lock);
#endif
for (auto i = _clients.begin(); i != _clients.end(); ++i) {
if (i->get() == client) {
_clients.erase(i);
break;
}
}
_adjust_inflight_window();
}
The text was updated successfully, but these errors were encountered:
Hello and thank you for your great work. Because I found also the solution for the bug, hopefully this short description is enough:
I wanted to switch from Websockets to SSE. However, I encountered an issue in release v3.6.2: If I disconnect a client, the esp32s3 crashs in this function:
Issue and simple fix:
By erasing an element from
_clients
the iterator becomes "unusable". Therefore it is necessary to break the loop after erase:The text was updated successfully, but these errors were encountered: