diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-07-16 19:43:38 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-07-16 19:43:38 +0000 |
commit | dcad2fe327598a92e2ca51feeb462bda7a5fa7c9 (patch) | |
tree | 05d1130ef0c4401d7cbfd10c301597618e76d8e0 /src | |
parent | c17d4bc92ce4482c847ebb6ddacf55df85497175 (diff) |
Fixing sendq crask
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4424 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/dnsqueue.cpp | 3 | ||||
-rw-r--r-- | src/users.cpp | 13 |
2 files changed, 6 insertions, 10 deletions
diff --git a/src/dnsqueue.cpp b/src/dnsqueue.cpp index 9c74d726c..5572c3247 100644 --- a/src/dnsqueue.cpp +++ b/src/dnsqueue.cpp @@ -177,7 +177,8 @@ public: if (resolver2.GetFD() != -1) { dnslist[resolver2.GetFD()] = this; - user_fd_to_dns[usr->fd] = this; + if (usr) + user_fd_to_dns[usr->fd] = this; } } } diff --git a/src/users.cpp b/src/users.cpp index 10a0a0353..ef2a58fd5 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -405,25 +405,20 @@ bool userrec::AddBuffer(const std::string &a) } recvq.append(b); - unsigned int i = 0; - - // count the size of the first line in the buffer. - while (i < recvq.length()) - { - if (recvq[i++] == '\n') - break; - } + //unsigned int i = 0; + if (recvq.length() > (unsigned)this->recvqmax) { this->SetWriteError("RecvQ exceeded"); WriteOpers("*** User %s RecvQ of %d exceeds connect class maximum of %d",this->nick,recvq.length(),this->recvqmax); + return false; } /* * return false if we've had more than 600 characters WITHOUT * a carriage return (this is BAD, drop the socket) */ - return (i < 600); + return true; } bool userrec::BufferIsReady() |