Store net.Addr in clientIDAddrMap

This fixes a stats collection bug where we were converting client
addresses between a string and net.Addr using the clientAddr function
multiple times, resulting in an empty string for all addresses.
This commit is contained in:
Cecylia Bocovich 2021-06-19 11:16:38 -04:00
parent aefabe683f
commit 6634f2bec9
4 changed files with 55 additions and 44 deletions

View file

@ -138,7 +138,7 @@ func turbotunnelMode(conn net.Conn, addr net.Addr, pconn *turbotunnel.QueuePacke
// recent WebSocket connection that has had to do with a session, at the
// time the session is established, is the IP address that should be
// credited for the entire KCP session.
clientIDAddrMap.Set(clientID, addr.String())
clientIDAddrMap.Set(clientID, addr)
var wg sync.WaitGroup
wg.Add(2)