[tor-commits] [snowflake/master] Remove unused Resetter interface.
dcf at torproject.org
dcf at torproject.org
Fri Apr 24 19:31:28 UTC 2020
commit 17c0d0ff82ccc0fad077ceb8ff8b20d580c56a24
Author: David Fifield <david at bamsoftware.com>
Date: Thu Apr 23 18:31:48 2020 -0600
Remove unused Resetter interface.
WaitForReset is not used since 70126177fbdf5b1fa4977f2fc26f624641708098.
---
client/lib/interfaces.go | 6 ------
client/lib/webrtc.go | 16 +---------------
2 files changed, 1 insertion(+), 21 deletions(-)
diff --git a/client/lib/interfaces.go b/client/lib/interfaces.go
index f6e8240..57171f8 100644
--- a/client/lib/interfaces.go
+++ b/client/lib/interfaces.go
@@ -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
}
diff --git a/client/lib/webrtc.go b/client/lib/webrtc.go
index e2a755f..719ea74 100644
--- a/client/lib/webrtc.go
+++ b/client/lib/webrtc.go
@@ -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.
More information about the tor-commits
mailing list