mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Process and properly log connection closure stats
This commit is contained in:
parent
5c5eb2c339
commit
caa2b36463
2 changed files with 2 additions and 1 deletions
|
@ -74,7 +74,7 @@ type EventOnProxyConnectionOver struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e EventOnProxyConnectionOver) String() string {
|
func (e EventOnProxyConnectionOver) String() string {
|
||||||
return fmt.Sprintf("Proxy connection closed (↑ %d, ↓ %d)", e.InboundTraffic, e.OutboundTraffic)
|
return fmt.Sprintf("Proxy connection closed")
|
||||||
}
|
}
|
||||||
|
|
||||||
type EventOnProxyStats struct {
|
type EventOnProxyStats struct {
|
||||||
|
|
|
@ -661,6 +661,7 @@ func (sf *SnowflakeProxy) Start() error {
|
||||||
if !sf.DisableStatsLogger {
|
if !sf.DisableStatsLogger {
|
||||||
sf.bytesLogger = newBytesSyncLogger()
|
sf.bytesLogger = newBytesSyncLogger()
|
||||||
sf.periodicProxyStats = newPeriodicProxyStats(sf.SummaryInterval, sf.EventDispatcher, sf.bytesLogger)
|
sf.periodicProxyStats = newPeriodicProxyStats(sf.SummaryInterval, sf.EventDispatcher, sf.bytesLogger)
|
||||||
|
sf.EventDispatcher.AddSnowflakeEventListener(sf.periodicProxyStats)
|
||||||
}
|
}
|
||||||
|
|
||||||
broker, err = newSignalingServer(sf.BrokerURL, sf.KeepLocalAddresses)
|
broker, err = newSignalingServer(sf.BrokerURL, sf.KeepLocalAddresses)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue