1
0
mirror of https://github.com/anope/anope.git synced 2026-07-09 09:23:13 +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 5ec1ca86b4
commit 48742435f5
+5
View File
@@ -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);