diff options
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() |