fix(rtmp_bridge): preserve ConnState on connect, deactivate on stream switch#33
Closed
cursor[bot] wants to merge 1 commit into
Closed
fix(rtmp_bridge): preserve ConnState on connect, deactivate on stream switch#33cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
…eam switch on_connect() used HashMap::insert which wiped publisher/player state when authorize_publish() already ran during the same poll() tick (fast handshake + publish). That rejected legitimate publishers and left ghost active publisher rows blocking re-publish. Also deactivate prior publisher/player DB rows when the same connection switches streams via a second publish/play on the same TCP session. Co-authored-by: Alexander Wagner <info@alexanderwagnerdev.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug scan: rtmp_bridge (2026-07-02)
Critical bugs fixed
on_connect()wiped authorized publisher statepoll()tick,authorize_publish()runs before the poll-loopon_connect().on_connect()usedHashMap::insert, replacing the ConnState that already held the publisher row.active=1publisher row blocks future publishes to that stream.Stream switch left ghost active DB rows
authorize_publish()/on_play()overwrote in-memory session state without deactivating the prior publisher/player row when the same TCP connection issued a second publish/play to a different stream.Fix
on_connect()now usesentry().or_insert_with()to preserve existing ConnState.authorize_publish()/on_play()deactivate any prior session row on the same connection before acquiring a new one.Tests
on_connect_preserves_prior_authorize_publish_stateauthorize_publish_switching_streams_deactivates_prior_publisheron_play_switching_streams_deactivates_prior_playerAll 13
rtmp_bridgeunit tests pass.