1
0
mirror of https://github.com/anope/anope.git synced 2026-06-28 14:16:38 +02:00

Properly handle single messages received that have no newline

This commit is contained in:
Adam
2010-07-24 03:31:41 -04:00
parent f9cd3f4238
commit b899a5c269
+5
View File
@@ -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);