Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/marian-nmt/Simple-WebSocket-Server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreidheim <eidheim@gmail.com>2020-02-13 14:05:52 +0300
committereidheim <eidheim@gmail.com>2020-02-13 14:05:52 +0300
commitc8480f78bdd8830f8f5c5e8e75be70e7b4f3d33d (patch)
tree07cc0a2faa1952c23b3640c8b8ff1b0b1e0ece81
parent656fd6fa1fb8eef1f4613bf1cb025f34d6e343f9 (diff)
Fixes #139: fixes Server::get_connections() crash when there are no connections
-rw-r--r--server_ws.hpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/server_ws.hpp b/server_ws.hpp
index 96205dc..bc55781 100644
--- a/server_ws.hpp
+++ b/server_ws.hpp
@@ -458,7 +458,8 @@ namespace SimpleWeb {
std::unordered_set<std::shared_ptr<Connection>> all_connections;
for(auto &e : endpoint) {
LockGuard lock(e.second.connections_mutex);
- all_connections.insert(e.second.connections.begin(), e.second.connections.end());
+ if(!e.second.connections.empty())
+ all_connections.insert(e.second.connections.begin(), e.second.connections.end());
}
return all_connections;
}