diff options
| author | 2010-10-10 00:46:55 -0400 | |
|---|---|---|
| committer | 2010-10-10 00:54:28 -0400 | |
| commit | de3871ce941ab3dc97cebb7a296c828428ab39a0 (patch) | |
| tree | f7f5cd34b52657ea3f07f8dd328e5923086a281e /src/modules/m_spanningtree/utils.cpp | |
| parent | Fix compilation (diff) | |
Rewrite TreeSocket timeout and lifecycle management
Diffstat (limited to 'src/modules/m_spanningtree/utils.cpp')
| -rw-r--r-- | src/modules/m_spanningtree/utils.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/modules/m_spanningtree/utils.cpp b/src/modules/m_spanningtree/utils.cpp index a0c7ef337..ca8ea8288 100644 --- a/src/modules/m_spanningtree/utils.cpp +++ b/src/modules/m_spanningtree/utils.cpp @@ -32,8 +32,9 @@ StreamSocket* ModuleSpanningTree::OnAcceptConnection(int newsock, ListenSocket* { if (*i == "*" || *i == incomingip || irc::sockets::cidr_mask(*i).match(*client)) { - /* we don't need to do anything with the pointer, creating it stores it in the necessary places */ - return new TreeSocket(Utils, newsock, from, client, server); + TreeSocket* sock = new TreeSocket(Utils, newsock, from, client, server); + Utils->Connections.push_back(sock); + return sock; } } ServerInstance->SNO->WriteToSnoMask('l', "Server connection from %s denied (no link blocks with that IP address)", incomingip.c_str()); @@ -111,10 +112,9 @@ CullResult SpanningTreeUtilities::cull() } } - for(std::map<TreeSocket*, std::pair<std::string, int> >::iterator i = timeoutlist.begin(); i != timeoutlist.end(); ++i) + for(size_t i = 0; i < Connections.size(); i++) { - TreeSocket* s = i->first; - s->Close(); + Connections[i]->Close(); } TreeRoot->cull(); |
