diff --git a/src/websocket_server.cpp b/src/websocket_server.cpp index a4187d5..ca4dae9 100644 --- a/src/websocket_server.cpp +++ b/src/websocket_server.cpp @@ -320,10 +320,22 @@ int WebSocketServer::wsCallback(struct lws *wsi, } } else if (event == "getConnections") { // Admin-Funktion: Liste aller aktiven Verbindungen + std::cout << "[RECEIVE] getConnections: Start" << std::endl; if (!ud) { std::cerr << "[RECEIVE] getConnections: ud ist nullptr" << std::endl; break; } + std::cout << "[RECEIVE] getConnections: ud ist gültig" << std::endl; + + // Prüfe ob ud noch gültig ist, bevor wir darauf zugreifen + try { + volatile bool test = ud->pongReceived; + (void)test; + std::cout << "[RECEIVE] getConnections: ud-Zugriff erfolgreich" << std::endl; + } catch (...) { + std::cerr << "[RECEIVE] getConnections: ud ist ungültig (Exception beim Zugriff)" << std::endl; + break; + } if (ud->userId.empty()) { std::cerr << "[RECEIVE] getConnections: User-ID nicht gesetzt" << std::endl;