summaryrefslogtreecommitdiff
path: root/src/connection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/connection.cpp')
-rw-r--r--src/connection.cpp15
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)
{