Skip to content

Commit

Permalink
prep 0.4.5 for Longse fix (see #77)
Browse files Browse the repository at this point in the history
  • Loading branch information
scottlamb committed Feb 2, 2023
1 parent 831a9d6 commit 320f208
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 9 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
## unreleased
## `v0.4.5` (2023-02-02)

* minimum Rust version is now 1.64.
* upgrade to `rtsp-types` 0.0.5, which ignores trailing whitespace in RTSP
headers. This fixes errors when communicating with some Longse cameras
([#77](https://github.com/scottlamb/retina/pull/77)).
* remove obsolete workaround for GW security GW security GW4089IP's bad out-of-band parameters.
Instead, we treat them as unparseable and ignore them as described in the
`v0.4.2` notes below.
Expand Down
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ default-members = ["."]

[package]
name = "retina"
version = "0.4.4"
version = "0.4.5"
authors = ["Scott Lamb <slamb@slamb.org>"]
license = "MIT/Apache-2.0"
edition = "2021"
Expand All @@ -28,7 +28,7 @@ once_cell = "1.7.2"
pin-project = "1.0.7"
pretty-hex = "0.3.0"
rand = "0.8.3"
rtsp-types = "0.0.3"
rtsp-types = "0.0.5"
sdp-types = "0.1.4"
smallvec = { version = "1.6.1", features = ["union"] }
thiserror = "1.0.25"
Expand Down
6 changes: 3 additions & 3 deletions fuzz/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions src/client/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,26 @@ mod tests {
})
}

/// Longse cameras, for whatever reason, have trailing whitespace in their `CSeq` header lines.
///
/// This test ensures this is correctly stripped. RTSP follows HTTP's lead for request/response
/// parsing (see [RFC 2326 section
/// 4.1](https://www.rfc-editor.org/rfc/rfc2326.html#page-19)), and HTTP [RFC
/// 9110 section 5.5](https://www.rfc-editor.org/rfc/rfc9110#name-field-values) says the following:
///
/// > A field value does not include leading or trailing whitespace. When a
/// > specific version of HTTP allows such whitespace to appear in a message,
/// > a field parsing implementation MUST exclude such whitespace prior to
/// > evaluating the field value.
///
/// Currently we rely on `rtsp-types` doing the stripping.
#[test]
fn longse_cseq() {
init_logging();
let response = response(include_bytes!("testdata/longse_unauthorized.txt"));
assert_eq!(super::get_cseq(&response), Some(1));
}

#[test]
fn anvpiz_sdp() {
init_logging();
Expand Down
5 changes: 5 additions & 0 deletions src/client/testdata/longse_unauthorized.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
RTSP/1.0 401 Unauthorized
CSeq: 1
Server: Rtsp Server 1920*1080*20*2048
WWW-Authenticate: Digest realm="Surveillance Server", nonce="98481030"

0 comments on commit 320f208

Please sign in to comment.