mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 04:07:35 +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:
parent
e941f07931
commit
85da8cbb07
1 changed files with 4 additions and 0 deletions
|
@ -24,6 +24,10 @@ void Parser::write(StringView data)
|
||||||
if (on_data)
|
if (on_data)
|
||||||
on_data("\n");
|
on_data("\n");
|
||||||
break;
|
break;
|
||||||
|
case '\0':
|
||||||
|
case '\n':
|
||||||
|
// Ignore.
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
if (on_data)
|
if (on_data)
|
||||||
on_data(StringView(&ch, 1));
|
on_data(StringView(&ch, 1));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue