Skip to content

Commit

Permalink
webrtcprivate: fix rcmgr bugs on listener
Browse files Browse the repository at this point in the history
  • Loading branch information
sukunrt committed Oct 16, 2023
1 parent 07903ee commit 6ac54f1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion p2p/transport/webrtcprivate/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,16 @@ func (l *listener) handleSignalingStream(s network.Stream) {
defer cancel()
defer s.Close()

scope, err := l.transport.rcmgr.OpenConnection(network.DirInbound, false, ma.StringCast("/webrtc")) // we don't have a better remote adress right now
scope, err := l.transport.rcmgr.OpenConnection(network.DirInbound, true, ma.StringCast("/webrtc")) // we don't have a better remote adress right now
if err != nil {
s.Reset()
log.Debug("failed to create connection scope:", err)
return
}
if err := scope.SetPeer(s.Conn().RemotePeer()); err != nil {
log.Debugf("resource manager blocked incoming conn from peer %s: %s", s.Conn().RemotePeer(), err)
return
}

if err := s.Scope().SetService(name); err != nil {
log.Debugf("error attaching stream to /webrtc listener: %s", err)
Expand Down

0 comments on commit 6ac54f1

Please sign in to comment.