[tor-commits] [snowflake/master] Keep track of clientAddr in statsChannel.

dcf at torproject.org dcf at torproject.org
Wed Oct 18 05:20:54 UTC 2017


commit 58556dc07bfba1c25687f2286d0f34319eabb125
Author: David Fifield <david at bamsoftware.com>
Date:   Tue Oct 17 22:19:43 2017 -0700

    Keep track of clientAddr in statsChannel.
---
 server/server.go | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/server/server.go b/server/server.go
index fff5887..5379c7f 100644
--- a/server/server.go
+++ b/server/server.go
@@ -155,7 +155,13 @@ func webSocketHandler(ws *websocket.WebSocket) {
 
 	// Pass the address of client as the remote address of incoming connection
 	clientIPParam := ws.Request().URL.Query().Get("client_ip")
-	or, err := pt.DialOr(&ptInfo, clientAddr(clientIPParam), ptMethodName)
+	addr := clientAddr(clientIPParam)
+	if addr == "" {
+		statsChannel <- false
+	} else {
+		statsChannel <- true
+	}
+	or, err := pt.DialOr(&ptInfo, addr, ptMethodName)
 
 	if err != nil {
 		log.Printf("failed to connect to ORPort: %s", err)



More information about the tor-commits mailing list