[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [pluggable-transports/snowflake] 01/02: Move tor-specific code outside of client library



This is an automated email from the git hooks/post-receive script.

cohosh pushed a commit to branch main
in repository pluggable-transports/snowflake.

commit d807e9d370e79ede725e45edf259223820bb7dc9
Author: Cecylia Bocovich <cohosh@xxxxxxxxxxxxxx>
AuthorDate: Mon Apr 11 11:38:52 2022 -0400

    Move tor-specific code outside of client library
---
 client/lib/lib_test.go              | 5 +++--
 client/{lib => }/pt_event_logger.go | 2 +-
 client/snowflake.go                 | 2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/client/lib/lib_test.go b/client/lib/lib_test.go
index 45e8fe2..e1b6427 100644
--- a/client/lib/lib_test.go
+++ b/client/lib/lib_test.go
@@ -6,6 +6,7 @@ import (
 	"testing"
 	"time"
 
+	"git.torproject.org/pluggable-transports/snowflake.git/v2/common/event"
 	. "github.com/smartystreets/goconvey/convey"
 )
 
@@ -171,8 +172,8 @@ func TestSnowflakeClient(t *testing.T) {
 
 func TestWebRTCPeer(t *testing.T) {
 	Convey("WebRTCPeer", t, func(c C) {
-		eventsLogger := NewPTEventLogger()
-		p := &WebRTCPeer{closed: make(chan struct{}), eventsLogger: eventsLogger}
+		p := &WebRTCPeer{closed: make(chan struct{}),
+			eventsLogger: event.NewSnowflakeEventDispatcher()}
 		Convey("checks for staleness", func() {
 			go p.checkForStaleness(time.Second)
 			<-time.After(2 * time.Second)
diff --git a/client/lib/pt_event_logger.go b/client/pt_event_logger.go
similarity index 97%
rename from client/lib/pt_event_logger.go
rename to client/pt_event_logger.go
index 25883c4..788c074 100644
--- a/client/lib/pt_event_logger.go
+++ b/client/pt_event_logger.go
@@ -1,4 +1,4 @@
-package snowflake_client
+package main
 
 import (
 	"fmt"
diff --git a/client/snowflake.go b/client/snowflake.go
index 33834ad..ac66a0d 100644
--- a/client/snowflake.go
+++ b/client/snowflake.go
@@ -104,7 +104,7 @@ func socksAcceptLoop(ln *pt.SocksListener, config sf.ClientConfig, shutdown chan
 				log.Println("Failed to start snowflake transport: ", err)
 				return
 			}
-			transport.AddSnowflakeEventListener(sf.NewPTEventLogger())
+			transport.AddSnowflakeEventListener(NewPTEventLogger())
 			err = conn.Grant(&net.TCPAddr{IP: net.IPv4zero, Port: 0})
 			if err != nil {
 				log.Printf("conn.Grant error: %s", err)

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits