Commit Graph
7 Commits
Author SHA1 Message Date
BFlat 7e92cb2f6d Merge pull request #3120 from dotCooCoo/fix/control-line-reader-behavior
craft-control: the server's line reader frames request lines as craft-control-protocol's does
2026-11-26 10:26:22 +07:00
dotCooCoo 5cd5f78e1e craft-control-protocol: the line cap does not count the line's \r\n
read_bounded_line read at most max + 1 bytes, so a line of exactly max
bytes followed by \r\n stopped after the \r and was refused, while the
same line followed by \n was read. It now reads up to max + 2 bytes,
strips the \n and a \r before it, and then checks the line against max.
A line of max + 1 bytes is still refused with either ending.
2026-11-22 15:51:15 -08:00
dotCooCoo 1f52a13a8e craft-control-protocol: write reply lines through a buffer
serve_lines wrote replies with writeln!, which hands the writer every
string, number and separator of the JSON value as a separate write. On
an unbuffered TcpStream that is one system call per piece. Replies and
the closing rejection now go through a 64 KiB BufWriter and are flushed
once per line, so a small reply is one write and a large one is a few
buffer-sized writes without a second whole copy in memory.
2026-11-20 10:43:52 -08:00
Dylan M. Taylor e2b5907a40 Test control framing failures and backpressure 2026-11-15 19:05:00 +00:00
Dylan M. Taylor edfd24c004 Share control client request and reply grammar 2026-11-15 19:00:31 +00:00
Dylan M. Taylor 2e6878d973 Share session token shape validation 2026-11-15 18:59:28 +00:00
Dylan M. Taylor 82276297a6 Share authenticated JSON-lines control protocol 2026-11-15 18:57:52 +00:00