[domistream] Host HTTP: tests first (request head and query parsing, caps, XML answers read back by the client parsers); API stubs return Unimplemented
This commit is contained in:
@@ -135,6 +135,20 @@ fn lying_inputs() -> Vec<Case> {
|
||||
v.push(("pairing secret", vec![0; 17], |b| {
|
||||
common::implemented(&domistream::pairing::crypto::split_pairing_secret(b))
|
||||
}));
|
||||
|
||||
// Host HTTP: a request head claiming a 4 GiB body, and a query of empty segments and many short parameters.
|
||||
v.push((
|
||||
"host request head",
|
||||
b"GET /launch?appid=1 HTTP/1.1\r\nContent-Length: 4294967295\r\n\r\n".to_vec(),
|
||||
|b| common::implemented(&domistream::host::http::parse_request_head(b)),
|
||||
));
|
||||
let mut q = b"/serverinfo?".to_vec();
|
||||
q.extend_from_slice(&b"&".repeat(4000));
|
||||
q.extend_from_slice(&b"a=%41&".repeat(32));
|
||||
v.push(("host target", q, |b| {
|
||||
common::implemented(&domistream::host::http::parse_target(&String::from_utf8_lossy(b)))
|
||||
}));
|
||||
v.push(("host head end", vec![b'a'; 70_000], |b| common::implemented(&domistream::host::http::find_head_end(b))));
|
||||
v
|
||||
}
|
||||
|
||||
@@ -267,6 +281,10 @@ fn parsers_never_allocate_past_their_caps() {
|
||||
("video", |b| common::implemented(&domistream::video::parse_video_packet(b))),
|
||||
("audio", |b| common::implemented(&domistream::audio::parse_audio_packet(b))),
|
||||
("video decrypt", |b| common::implemented(&domistream::video::VideoCipher::new([2; 16]).decrypt(b))),
|
||||
("host request head", |b| common::implemented(&domistream::host::http::parse_request_head(b))),
|
||||
("host target", |b| common::implemented(&domistream::host::http::parse_target(&String::from_utf8_lossy(b)))),
|
||||
("host query", |b| common::implemented(&domistream::host::http::parse_query(&String::from_utf8_lossy(b)))),
|
||||
("host head end", |b| common::implemented(&domistream::host::http::find_head_end(b))),
|
||||
("audio decrypt", |b| {
|
||||
common::implemented(
|
||||
&domistream::audio::AudioCipher::new(&SessionKeys { rikey: [2; 16], rikeyid: 0 }).decrypt(0, b),
|
||||
|
||||
Reference in New Issue
Block a user