From 7b37009dca64565dbd0143035e8729b9b45ecc8b Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 1 Apr 2005 22:40:14 +0000 Subject: Fixed nasty bugs. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@944 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspircd.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 18b220e18..cf1d8b9f9 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -98,7 +98,7 @@ std::vector module_names; extern std::vector factory; std::vector fd_reap; -std::vector pending_connects; +std::string pending_connects[MAXBUF]; extern int MODCOUNT; @@ -2440,11 +2440,11 @@ void FullConnectUser(userrec* user) // handles any connects where DNS isnt done yet, times out stale dns queries on users, and lets completed queries connect. void HandlePendingConnects() { - if (pending_connects.size()) + for (long i = 0; i < MAXBUF; i++) { - for (std::vector::iterator i = pending_connects.begin(); i <= pending_connects.end(); i++) + std::string t = pending_connects[i]; + if (t != "") { - std::string t = *i; userrec* a = Find(t); if (a) { @@ -2452,7 +2452,7 @@ void HandlePendingConnects() if ((a->dns_done) && (a->registered == 3)) { FullConnectUser(a); // attack! attack!.... - pending_connects.erase(i); + pending_connects[i] = ""; return; // ...RUN AWAY! RUN AWAY! } // this users dns is NOT done, but its timed out. @@ -2460,7 +2460,7 @@ void HandlePendingConnects() { WriteServ(a->fd,"NOTICE Auth :Failed to resolve your hostname, using your IP address instead."); FullConnectUser(a); - pending_connects.erase(i); + pending_connects[i] = ""; return; } } @@ -2479,7 +2479,11 @@ void ConnectUser(userrec *user) else { // add them to the pending queue - pending_connects.push_back(user->nick); + for (int i = 0; i < MAXBUF; i++) + { + pending_connects[i] = std::string(user->nick); + break; + } } } -- cgit v1.2.3