Skip to content

Commit

Permalink
Unexport ICETransport.NewEndpoint
Browse files Browse the repository at this point in the history
This is a Pion-ism that accidentally was exported.
  • Loading branch information
Sean-Der committed Apr 11, 2021
1 parent e2fd97b commit 525d725
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions dtlstransport.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,8 @@ func (t *DTLSTransport) Start(remoteParameters DTLSParameters) error {
return DTLSRole(0), nil, &rtcerr.InvalidStateError{Err: fmt.Errorf("%w: %s", errInvalidDTLSStart, t.state)}
}

t.srtpEndpoint = t.iceTransport.NewEndpoint(mux.MatchSRTP)
t.srtcpEndpoint = t.iceTransport.NewEndpoint(mux.MatchSRTCP)
t.srtpEndpoint = t.iceTransport.newEndpoint(mux.MatchSRTP)
t.srtcpEndpoint = t.iceTransport.newEndpoint(mux.MatchSRTCP)
t.remoteParameters = remoteParameters

cert := t.certificates[0]
Expand All @@ -309,7 +309,7 @@ func (t *DTLSTransport) Start(remoteParameters DTLSParameters) error {
}

var dtlsConn *dtls.Conn
dtlsEndpoint := t.iceTransport.NewEndpoint(mux.MatchDTLS)
dtlsEndpoint := t.iceTransport.newEndpoint(mux.MatchDTLS)
role, dtlsConfig, err := prepareTransport()
if err != nil {
return err
Expand Down
3 changes: 1 addition & 2 deletions icetransport.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,7 @@ func (t *ICETransport) setState(i ICETransportState) {
t.state.Store(i)
}

// NewEndpoint registers a new endpoint on the underlying mux.
func (t *ICETransport) NewEndpoint(f mux.MatchFunc) *mux.Endpoint {
func (t *ICETransport) newEndpoint(f mux.MatchFunc) *mux.Endpoint {
t.lock.Lock()
defer t.lock.Unlock()
return t.mux.NewEndpoint(f)
Expand Down

0 comments on commit 525d725

Please sign in to comment.