Skip to content

Commit

Permalink
fix: add_subscribe
Browse files Browse the repository at this point in the history
  • Loading branch information
hongcha98 committed Dec 23, 2023
1 parent 0248de0 commit b353686
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/forward/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,6 @@ impl PeerForward {
RTCPeerConnectionState::Failed | RTCPeerConnectionState::Disconnected => {
let _ = pc.close().await;
}
RTCPeerConnectionState::Connected => {
metrics::SUBSCRIBE.inc();
let _ = internal.add_subscribe(pc).await;
}
RTCPeerConnectionState::Closed => {
metrics::SUBSCRIBE.dec();
let _ = internal.remove_subscribe(pc).await;
Expand All @@ -140,10 +136,13 @@ impl PeerForward {
}
Box::pin(async {})
}));
Ok((
let (sdp, key) = (
peer_complete(offer, peer.clone()).await?,
get_peer_key(peer),
))
get_peer_key(peer.clone()),
);
metrics::SUBSCRIBE.inc();
let _ = self.internal.add_subscribe(peer).await?;
Ok((sdp, key))
}

pub async fn add_ice_candidate(&self, key: String, ice_candidates: String) -> Result<()> {
Expand Down

0 comments on commit b353686

Please sign in to comment.