bound the request line on the host admin and in-agent sockets
hive-c0re's admin socket and hive-agent's in-agent socket (mode 0666) read the request with an unbounded read_line: no length cap and no deadline, so a peer that never sends a newline grows a buffer and pins a task forever. The bounded reader (16 MiB cap) moves from hive-c0re's socket_server into hive-sock-client, the one crate both daemons already share or can take, and gains optional deadlines for the first byte and for the rest of the line. Both sockets now use it and answer an over-long or stalled line with the same error reply the bounded sockets give, then close. The admin socket bounds only the started line (clients may idle between requests); the in-agent socket is single-shot and bounds silence too. The per-agent sockets keep their behaviour (no deadline).
This commit is contained in:
parent
88dd58e947
commit
1f214f9f01
10 changed files with 425 additions and 87 deletions
|
|
@ -1,5 +1,6 @@
|
|||
# `hive-sock-client` — the one JSON-line-over-unix-socket client shared by
|
||||
# every daemon that talks to a hyperhive socket. Protocol-agnostic on
|
||||
# every daemon that talks to a hyperhive socket, plus the bounded
|
||||
# request-line reader the socket servers share. Protocol-agnostic on
|
||||
# purpose: it is generic over the request/response types, so it works for
|
||||
# the host-served control socket and the harness's in-agent socket alike.
|
||||
# Deliberately NOT folded into one of the `*-sock` wire-type crates —
|
||||
|
|
|
|||
Loading…
Reference in a new issue