fix: import LazyLock in on_media_cb hex-label unit test - #219
Conversation
- Surface non-UTF-8 FourCC and unknown legacy codec nibbles to on_media_cb via stable labels instead of None, and deny frames with no codec identity - Require tls_insecure == 1 (not any non-zero) to disable RTMPS verification Co-authored-by: Alexander Wagner <info@alexanderwagnerdev.com>
PR #218 added a test using LazyLock without the local import that other conn.rs tests use, causing cargo test and sanitizer jobs to fail at compile time. Co-authored-by: Alexander Wagner <info@alexanderwagnerdev.com>
|
ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 609d706. Configure here.
| AudioCodec::Mp3 => Some("mp3".to_string()), | ||
| AudioCodec::Opus => Some("Opus".to_string()), | ||
| _ => None, | ||
| other => Some(format!("legacy:{other:?}")), |
There was a problem hiding this comment.
Unstable audio legacy auth labels
Medium Severity
Legacy video unknown codecs get stable legacy:{nibble} identities for on_media_cb, but the matching audio catch-all emits legacy:{other:?} from the post-parse AudioCodec enum. That Debug string is not a stable auth contract, and unknown sound-format nibbles still collapse to AudioCodec::Aac in exaudio_parse, so they keep surfacing as mp4a instead of a distinct legacy label.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 609d706. Configure here.


Summary
Fixes CI compile failures introduced by PR #218.
Root cause
The new
on_media_cb_receives_hex_label_for_non_utf8_fourcctest usesLazyLockandMutexwithout the localuse std::sync::{LazyLock, Mutex};import that other tests inconn.rsfollow.Fix
Add the missing import inside the test function.
CI impact
Resolves failures in:
cargo testASan (unit tests)Overflow checks (unit tests)Note
High Risk
Changes TLS verification semantics and publisher authorization paths that integrators rely on for security; behavior shifts (stricter TLS, more frames denied) may affect existing deployments.
Overview
Tightens RTMPS client FFI behavior so
tls_insecuredisables certificate verification only when it is exactly1, matching the documentedmax_connectionspattern so uninitialized config memory cannot accidentally skip TLS checks.Publisher media authorization (
on_media_cb) no longer treats unknown codecs asNone, which previously let deny lists be bypassed. Codec identity is surfaced viafourcc_auth_label(UTF-8 FourCC orfourcc:…hex) and stablelegacy:…labels for non-enhanced video/audio; audio/video with no resolvable codec are rejected when a callback is installed. Multitrack paths use the same labels per track.Adds unit tests for hex FourCC labels, legacy nibble blocking, and the hex-label test’s
LazyLock/Muteximport so CI compiles.Reviewed by Cursor Bugbot for commit 609d706. Bugbot is set up for automated code reviews on this repo. Configure here.