diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-04-22 21:16:09 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-04-22 21:16:09 +0000 |
commit | 4fff701800cfb3f5a27d7889561dceba18e29239 (patch) | |
tree | b7577b5d100b86987be7fe25280ba78c07603969 /src/connection.cpp | |
parent | 20bf4e0a20cb42f02f361bd955dad9516b4201b9 (diff) |
Fixed weird issues when anope sends large amounts of text at once to the uplink
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1164 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/connection.cpp')
-rw-r--r-- | src/connection.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/connection.cpp b/src/connection.cpp index b197caef1..f6b2cea96 100644 --- a/src/connection.cpp +++ b/src/connection.cpp @@ -436,6 +436,21 @@ bool connection::RecvPacket(std::deque<std::string> &messages, char* host) } if (rcvsize > 0) { + if ((data[rcvsize-1] != '\r') && (data[rcvsize-1] != '\n')) + { + char foo = ' '; + while ((foo != '\n') && (rcvsize < 32767)) + { + int x = recv(this->connectors[i].GetDescriptor(),(void*)&foo,1,0); + if ((x == -1) && (errno != EAGAIN)) + break; + if ((x) && (rcvsize < 32767)) + { + data[rcvsize] = foo; + data[++rcvsize] = '\0'; + } + } + } char* l = strtok(data,"\n"); while (l) { |