mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Make BytesSyncLogger's implementation details internal.
Provide NewBytesSyncLogger that returns an opaque data structure. Automatically start up the logging loop goroutine in NewBytesSyncLogger.
This commit is contained in:
parent
9a4e3e7bd9
commit
2853fc9362
2 changed files with 29 additions and 33 deletions
|
@ -161,15 +161,7 @@ func main() {
|
|||
snowflakes.Tongue = sf.NewWebRTCDialer(broker, iceServers)
|
||||
|
||||
// Use a real logger to periodically output how much traffic is happening.
|
||||
snowflakes.BytesLogger = &sf.BytesSyncLogger{
|
||||
InboundChan: make(chan int, 5),
|
||||
OutboundChan: make(chan int, 5),
|
||||
Inbound: 0,
|
||||
Outbound: 0,
|
||||
InEvents: 0,
|
||||
OutEvents: 0,
|
||||
}
|
||||
go snowflakes.BytesLogger.Log()
|
||||
snowflakes.BytesLogger = sf.NewBytesSyncLogger()
|
||||
|
||||
go ConnectLoop(snowflakes)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue