mirror of
https://github.com/rustdesk/hbb_common.git
synced 2026-10-19 07:04:10 +00:00
31d3789079cfc382d81ee611fe114579de90d3aa
Taken from upstream #589. The eviction in the state handler re-derived the cache key from `pc.local_description()` while holding SESSIONS - an await under the lock, on a webrtc-rs internal mutex, in the one callback that runs inline from `pc.close()`. The identity scan needs no description: it is synchronous, and it already was the fallback for the key-derivation failure, so the two paths collapse into one. The duplicate-offer guard survives unchanged, because a scan by `Arc::ptr_eq` cannot touch the winner sharing the key. The data-channel guard is released before `close()` rather than held across it, so a concurrent `detach()` on the same stream cannot stall behind the peer's teardown. Upstream's `cache_or_reuse_session` and its deadlock test are not carried: the insert path here goes through `NewStreamHandoff` and never closes a pc under the lock, so the function had no caller and the test exercised nothing this tree can do. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019aokqJuhjvB3kijXtAg5Ns
Description
No description provided
75 MiB
Languages
Rust
100%