[domistream] Control: tests first, START_B, PERIODIC_PING and the IDR request with empty bodies (START_A stays refused)

This commit is contained in:
2026-12-04 13:45:04 +01:00
parent 51db5a962b
commit 66679229db
2 changed files with 14 additions and 6 deletions
+11 -4
View File
@@ -381,11 +381,18 @@ fn client_messages() {
encode_client_message(&ClientMessage::Input(ev.clone())).unwrap(), encode_client_message(&ClientMessage::Input(ev.clone())).unwrap(),
domistream::input::encode_input(&ev).unwrap() domistream::input::encode_input(&ev).unwrap()
); );
// Bodies still UNKNOWN (U10) are refused rather than guessed. // START_B, PERIODIC_PING and the IDR request go with an empty body (PROTOCOL.md 3.3: what Moonshine and Lumen
for m in [ClientMessage::StartA, ClientMessage::StartB, ClientMessage::PeriodicPing, ClientMessage::RequestIdrFrame] // read; the lead's decision of 2026-12-04). START_A's body is still UNKNOWN (U10) and stays refused.
{ for (m, t) in [
assert_err!(encode_client_message(&m), Error::Unsupported { .. }, "{m:?}"); (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! { 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) (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. // ENet connect on the control port, then START_B. ControlStream sends START_B with an empty body (3.3); the
assert_err!(encode_client_message(&ClientMessage::StartB), Error::Unsupported { .. }); // 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 { let host_control = HostControl {
config: ControlHostConfig { config: ControlHostConfig {
enet: EnetHostConfig { enet: EnetHostConfig {