diff options
author | Adam <Adam@anope.org> | 2010-07-24 03:31:41 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2010-07-24 03:32:43 -0400 |
commit | 48742435f52bf2f1cf6f8cf496c9297d8fce1d1f (patch) | |
tree | f3af85d5aca7974edfce309a0ccebcf6c4a736ef | |
parent | 5ec1ca86b43828599d46e4b5c7a3d5f64ff1ef37 (diff) |
Properly handle single messages received that have no newline
-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 861cd26d8..84c360fec 100644 --- a/src/sockets.cpp +++ b/src/sockets.cpp @@ -202,6 +202,11 @@ bool Socket::ProcessRead() sbuffer.append(buffer); 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); |