Skip to content

Commit ccd31ff

Browse files
committed
fixed a bug
fixed a bug that would manifest when shutting down a server that was being listened to by clients
1 parent a11d117 commit ccd31ff

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

VVOSCQueryProtocol/WSPPServer.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,10 @@ void WSPPServer::_initServer() {
295295
for (std::map<string,vector<connection_hdl>>::iterator addrServerIt=servers_by_listenAddr.begin(); addrServerIt!=servers_by_listenAddr.end(); ) {
296296
// run through each connection in this entry
297297
vector<connection_hdl> &serverConns = addrServerIt->second;
298+
if (serverConns.size()<1) {
299+
++addrServerIt;
300+
continue;
301+
}
298302
for (std::vector<connection_hdl>::iterator serverConnIt=serverConns.begin(); serverConnIt!=serverConns.end(); ) {
299303
// if this connection matches the server that's closing
300304
if (server->get_con_from_hdl(*serverConnIt, ec) == hdlToFind) {

0 commit comments

Comments
 (0)