mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Move ptEventLogger into the client/snowflake.go
Remove client/pt_event_logger.go file as is very minimal.
This commit is contained in:
parent
1d592b06e5
commit
3473b438e5
2 changed files with 12 additions and 17 deletions
|
@ -1,17 +0,0 @@
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
pt "git.torproject.org/pluggable-transports/goptlib.git"
|
|
||||||
"git.torproject.org/pluggable-transports/snowflake.git/v2/common/event"
|
|
||||||
)
|
|
||||||
|
|
||||||
func NewPTEventLogger() event.SnowflakeEventReceiver {
|
|
||||||
return &ptEventLogger{}
|
|
||||||
}
|
|
||||||
|
|
||||||
type ptEventLogger struct {
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p ptEventLogger) OnNewSnowflakeEvent(e event.SnowflakeEvent) {
|
|
||||||
pt.Log(pt.LogSeverityNotice, e.String())
|
|
||||||
}
|
|
|
@ -17,6 +17,7 @@ import (
|
||||||
|
|
||||||
pt "git.torproject.org/pluggable-transports/goptlib.git"
|
pt "git.torproject.org/pluggable-transports/goptlib.git"
|
||||||
sf "git.torproject.org/pluggable-transports/snowflake.git/v2/client/lib"
|
sf "git.torproject.org/pluggable-transports/snowflake.git/v2/client/lib"
|
||||||
|
"git.torproject.org/pluggable-transports/snowflake.git/v2/common/event"
|
||||||
"git.torproject.org/pluggable-transports/snowflake.git/v2/common/safelog"
|
"git.torproject.org/pluggable-transports/snowflake.git/v2/common/safelog"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -24,6 +25,17 @@ const (
|
||||||
DefaultSnowflakeCapacity = 1
|
DefaultSnowflakeCapacity = 1
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type ptEventLogger struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewPTEventLogger() event.SnowflakeEventReceiver {
|
||||||
|
return &ptEventLogger{}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p ptEventLogger) OnNewSnowflakeEvent(e event.SnowflakeEvent) {
|
||||||
|
pt.Log(pt.LogSeverityNotice, e.String())
|
||||||
|
}
|
||||||
|
|
||||||
// Exchanges bytes between two ReadWriters.
|
// Exchanges bytes between two ReadWriters.
|
||||||
// (In this case, between a SOCKS connection and a snowflake transport conn)
|
// (In this case, between a SOCKS connection and a snowflake transport conn)
|
||||||
func copyLoop(socks, sfconn io.ReadWriter) {
|
func copyLoop(socks, sfconn io.ReadWriter) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue