Explorar el Código

Fix: deferred NoticeTotalBytesTransferred now reports correct values

Rod Hynes hace 10 años
padre
commit
d8703f88a7
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. 3 1
      psiphon/tunnel.go

+ 3 - 1
psiphon/tunnel.go

@@ -542,7 +542,9 @@ func (tunnel *Tunnel) operateTunnel(config *Config, tunnelOwner TunnelOwner) {
 	totalReceived := int64(0)
 
 	// Always emit a final NoticeTotalBytesTransferred
-	defer NoticeTotalBytesTransferred(tunnel.serverEntry.IpAddress, totalSent, totalReceived)
+	defer func() {
+		NoticeTotalBytesTransferred(tunnel.serverEntry.IpAddress, totalSent, totalReceived)
+	}()
 
 	noticeBytesTransferredTicker := time.NewTicker(1 * time.Second)
 	defer noticeBytesTransferredTicker.Stop()