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