diff options
author | Adam <Adam@anope.org> | 2010-07-24 03:31:41 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2010-07-24 03:31:41 -0400 |
commit | b899a5c26911600129384b883bb832dccdd8ac04 (patch) | |
tree | c0965b968f653d8ab51ff753275760a66ccb6146 /src/sockets.cpp | |
parent | f9cd3f42385552f5889ccd293eab0faa02212b34 (diff) |
Properly handle single messages received that have no newline
Diffstat (limited to 'src/sockets.cpp')
-rw-r--r-- | src/sockets.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/sockets.cpp b/src/sockets.cpp index 15592c7d6..f2e0d65f6 100644 --- a/src/sockets.cpp +++ b/src/sockets.cpp @@ -105,6 +105,11 @@ bool Socket::ProcessRead() sbuffer.append(tbuffer); extrabuf.clear(); size_t lastnewline = sbuffer.find_last_of('\n'); + if (lastnewline == std::string::npos) + { + extrabuf = sbuffer; + return true; + } if (lastnewline < sbuffer.size() - 1) { extrabuf = sbuffer.substr(lastnewline); |