mirror of
https://github.com/rustdesk/hbb_common.git
synced 2026-08-27 04:37:35 +00:00
webrtc: record why WebRTCStream has no Drop
An absent impl is invisible in the source, and this one keeps being proposed. Closing on each clone's drop would end a live session the moment a losing race future is dropped; closing on the last clone is circular, since the cache entry is itself a clone and is removed by the state handler a close fires. Ownership is carried by `OffererGuard` and `Stream::WebRTC` instead, so say so where someone adding another holder will look. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019UzcMTdYTEv2QbMHcTSUy3
This commit is contained in:
@@ -57,6 +57,11 @@ enum WebRTCConnectionState {
|
||||
Closed(String),
|
||||
}
|
||||
|
||||
/// A shared handle, not an owner: every clone points at the same `pc`, and `SESSIONS` holds one
|
||||
/// of those clones. Hence no `Drop` — closing per clone would kill a live session as soon as a
|
||||
/// losing race future is dropped, and closing on the last clone would wait on the very close
|
||||
/// that evicts the cache entry. Ownership is `OffererGuard` until a connection attempt adopts
|
||||
/// the stream and `Stream::WebRTC` after; holding one outside those two means closing it by hand.
|
||||
pub struct WebRTCStream {
|
||||
pc: Arc<RTCPeerConnection>,
|
||||
stream: Arc<Mutex<Arc<RTCDataChannel>>>,
|
||||
|
||||
Reference in New Issue
Block a user