brokerd: close the connection after the final frame again

hold_open (d21baa2) kept each connection open for up to two seconds
after its final frame, reading and dropping anything the peer sent, to
hide a test client that set a read timeout after the handler had closed.
On macOS that call fails with EINVAL; the clients now allow for it
(00a85c1, d7009dc), so the handler goes back to closing at once.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-22 18:32:31 -07:00
co-authored by Claude Opus 5.5
parent d7009dc488
commit 57dc7899a9
2 changed files with 1 additions and 26 deletions
+1 -3
View File
@@ -4,7 +4,7 @@
use std::os::unix::net::UnixStream;
use crate::approvals::Entry;
use crate::broker::{Broker, forbid, hold_open, read_request, send};
use crate::broker::{Broker, forbid, read_request, send};
use crate::grants;
use crate::ledger::{Answer, Answered};
use proto::{
@@ -120,12 +120,10 @@ pub fn handle(mut stream: UnixStream, broker: &Broker) {
}
other => {
forbid(broker, &mut stream, id, &other, "admin.sock");
hold_open(&mut stream);
return;
}
};
// 3. The final frame; a failed send is ignored.
let _ = send(&mut stream, id, true, response);
hold_open(&mut stream);
}