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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user