mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-14 05:11:19 -04:00
Remove unused Resetter interface.
WaitForReset is not used since 70126177fb
.
This commit is contained in:
parent
6c2e3adc41
commit
17c0d0ff82
2 changed files with 1 additions and 21 deletions
|
@ -9,16 +9,10 @@ type Connector interface {
|
|||
Connect() error
|
||||
}
|
||||
|
||||
type Resetter interface {
|
||||
Reset()
|
||||
WaitForReset()
|
||||
}
|
||||
|
||||
// Interface for a single remote WebRTC peer.
|
||||
// In the Client context, "Snowflake" refers to the remote browser proxy.
|
||||
type Snowflake interface {
|
||||
io.ReadWriteCloser
|
||||
Resetter
|
||||
Connector
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ import (
|
|||
|
||||
// Remote WebRTC peer.
|
||||
// Implements the |Snowflake| interface, which includes
|
||||
// |io.ReadWriter|, |Resetter|, and |Connector|.
|
||||
// |io.ReadWriter| and |Connector|.
|
||||
//
|
||||
// Handles preparation of go-webrtc PeerConnection. Only ever has
|
||||
// one DataChannel.
|
||||
|
@ -33,7 +33,6 @@ type WebRTCPeer struct {
|
|||
writePipe *io.PipeWriter
|
||||
lastReceive time.Time
|
||||
buffer bytes.Buffer
|
||||
reset chan struct{}
|
||||
|
||||
closed bool
|
||||
|
||||
|
@ -61,7 +60,6 @@ func NewWebRTCPeer(config *webrtc.Configuration,
|
|||
// Error channel is mostly for reporting during the initial SDP offer
|
||||
// creation & local description setting, which happens asynchronously.
|
||||
connection.errorChannel = make(chan error, 1)
|
||||
connection.reset = make(chan struct{}, 1)
|
||||
|
||||
// Override with something that's not NullLogger to have real logging.
|
||||
connection.BytesLogger = &BytesNullLogger{}
|
||||
|
@ -98,23 +96,11 @@ func (c *WebRTCPeer) Close() error {
|
|||
c.once.Do(func() {
|
||||
c.closed = true
|
||||
c.cleanup()
|
||||
c.Reset()
|
||||
log.Printf("WebRTC: Closing")
|
||||
})
|
||||
return nil
|
||||
}
|
||||
|
||||
// As part of |Resetter|
|
||||
func (c *WebRTCPeer) Reset() {
|
||||
if nil == c.reset {
|
||||
return
|
||||
}
|
||||
c.reset <- struct{}{}
|
||||
}
|
||||
|
||||
// As part of |Resetter|
|
||||
func (c *WebRTCPeer) WaitForReset() { <-c.reset }
|
||||
|
||||
// Prevent long-lived broken remotes.
|
||||
// Should also update the DataChannel in underlying go-webrtc's to make Closes
|
||||
// more immediate / responsive.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue