[domistream] Control: empty-body START_B, PERIODIC_PING, IDR request #15

Merged
mnovak merged 2 commits from feature/control-empty-bodies into main 2026-12-04 13:46:40 +01:00
2 changed files with 14 additions and 6 deletions
Showing only changes of commit 66679229db - Show all commits
+11 -4
View File
@@ -381,11 +381,18 @@ fn client_messages() {
encode_client_message(&ClientMessage::Input(ev.clone())).unwrap(),
domistream::input::encode_input(&ev).unwrap()
);
// Bodies still UNKNOWN (U10) are refused rather than guessed.
for m in [ClientMessage::StartA, ClientMessage::StartB, ClientMessage::PeriodicPing, ClientMessage::RequestIdrFrame]
{
assert_err!(encode_client_message(&m), Error::Unsupported { .. }, "{m:?}");
// START_B, PERIODIC_PING and the IDR request go with an empty body (PROTOCOL.md 3.3: what Moonshine and Lumen
// read; the lead's decision of 2026-12-04). START_A's body is still UNKNOWN (U10) and stays refused.
for (m, t) in [
(ClientMessage::StartB, 0x0307u16),
(ClientMessage::PeriodicPing, 0x0200),
(ClientMessage::RequestIdrFrame, 0x0302),
] {
let mut want = t.to_le_bytes().to_vec();
want.extend_from_slice(&0u16.to_le_bytes());
assert_eq!(encode_client_message(&m).unwrap(), want, "{m:?}");
}
assert_err!(encode_client_message(&ClientMessage::StartA), Error::Unsupported { .. });
}
proptest! {
+3 -2
View File
@@ -623,8 +623,9 @@ fn a_whole_session_between_our_client_and_our_host() {
(launched.mode.width, launched.mode.height, launched.mode.fps)
);
// ENet connect on the control port, then START_B. ControlStream refuses START_B (body U10), hence the probe path.
assert_err!(encode_client_message(&ClientMessage::StartB), Error::Unsupported { .. });
// ENet connect on the control port, then START_B. ControlStream sends START_B with an empty body (3.3); the
// session below drives the same bytes over EnetClient + ControlCipher, as gs-probe does.
assert_eq!(encode_client_message(&ClientMessage::StartB).unwrap(), vec![0x07, 0x03, 0x00, 0x00]);
let host_control = HostControl {
config: ControlHostConfig {
enet: EnetHostConfig {