2
0
mirror of synced 2025-02-24 14:48:27 +00:00

Include connection network in log message

This commit is contained in:
Matt Joiner 2018-04-14 11:24:06 +10:00
parent e04b6f0ba0
commit 5c81c6c70a

View File

@ -394,7 +394,7 @@ func (cl *Client) acceptConnections(l net.Listener) {
// routine just fucked off.
return
}
log.Fmsg("accepted connection from %s", conn.RemoteAddr()).AddValue(debugLogValue).Log(cl.logger)
log.Fmsg("accepted %s connection from %s", conn.RemoteAddr().Network(), conn.RemoteAddr()).AddValue(debugLogValue).Log(cl.logger)
go torrent.Add(fmt.Sprintf("accepted conn remote IP len=%d", len(missinggo.AddrIP(conn.RemoteAddr()))), 1)
go torrent.Add(fmt.Sprintf("accepted conn network=%s", conn.RemoteAddr().Network()), 1)
go torrent.Add(fmt.Sprintf("accepted on %s listener", l.Addr().Network()), 1)