[domistream] RTSP server: session state machine, DESCRIBE writer, strict ANNOUNCE parser, response encoder and request framer; test fixes (escaped CRLF in alloc_caps, CSeq test state, clippy)

This commit is contained in:
2026-12-04 12:31:28 +01:00
parent 27b7f2bf1d
commit a86a689b1f
7 changed files with 597 additions and 69 deletions
+4 -15
View File
@@ -62,23 +62,12 @@ fn lying_inputs() -> Vec<Case> {
));
v.push((
"rtsp server",
b"ANNOUNCE x RTSP/1.0
CSeq: 1
Content-Length: 4294967295
abc"
.to_vec(),
b"ANNOUNCE x RTSP/1.0\r\nCSeq: 1\r\nContent-Length: 4294967295\r\n\r\nabc".to_vec(),
rtsp_server_answers,
));
// ANNOUNCE: numbers far past any range, a line that claims nothing but is long, many unknown attributes.
let mut announce = b"a=x-nv-video[0].clientViewportWd:99999999999999999999999999999999
"
.to_vec();
announce.extend_from_slice(
&b"a=u:1
"
.repeat(600),
);
// ANNOUNCE: a number far past any range, then more unknown attributes than the cap allows.
let mut announce = b"a=x-nv-video[0].clientViewportWd:99999999999999999999999999999999\n".to_vec();
announce.extend_from_slice(&b"a=u:1\n".repeat(600));
v.push(("announce", announce, |b| common::implemented(&domistream::rtsp::server::parse_announce(b))));
v.push(("rtsp framer", rtsp, |b| {
let mut f = domistream::rtsp::RtspFramer::new();