1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:47:44 +00:00

TelnetServer: Ignore null and \n when parsing

This fixes issues with carriage return sequences.

Before, using <CR><NUL> as the return sequence wouldn't work at all,
and when using <CR><LF> there was an extra newline after every newline.

After this patch, the behaviour should be closer to the Telnet RFC.
This commit is contained in:
Aatos Majava 2022-04-14 15:54:03 +03:00 committed by Andreas Kling
parent e941f07931
commit 85da8cbb07

View file

@ -24,6 +24,10 @@ void Parser::write(StringView data)
if (on_data)
on_data("\n");
break;
case '\0':
case '\n':
// Ignore.
break;
default:
if (on_data)
on_data(StringView(&ch, 1));