From 99109e636bb7887193aa2e54b9c9df4e58656e5b Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Mon, 21 Mar 2016 16:02:36 +1100 Subject: [PATCH] Use missinggo.AddrPort directly --- client.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/client.go b/client.go index 673f6e5d..885b204e 100644 --- a/client.go +++ b/client.go @@ -234,7 +234,7 @@ func (cl *Client) WriteStatus(_w io.Writer) { dhtStats := cl.dHT.Stats() fmt.Fprintf(w, "DHT nodes: %d (%d good, %d banned)\n", dhtStats.Nodes, dhtStats.GoodNodes, dhtStats.BadNodes) fmt.Fprintf(w, "DHT Server ID: %x\n", cl.dHT.ID()) - fmt.Fprintf(w, "DHT port: %d\n", addrPort(cl.dHT.Addr())) + fmt.Fprintf(w, "DHT port: %d\n", missinggo.AddrPort(cl.dHT.Addr())) fmt.Fprintf(w, "DHT announces: %d\n", dhtStats.ConfirmedAnnounces) fmt.Fprintf(w, "Outstanding transactions: %d\n", dhtStats.OutstandingTransactions) } @@ -801,7 +801,7 @@ func (cl *Client) incomingPeerPort() int { if listenAddr == nil { return 0 } - return addrPort(listenAddr) + return missinggo.AddrPort(listenAddr) } // Convert a net.Addr to its compact IP representation. Either 4 or 16 bytes @@ -1267,11 +1267,6 @@ func (cl *Client) gotMetadataExtensionMsg(payload []byte, t *torrent, c *connect return } -// Extracts the port as an integer from an address string. -func addrPort(addr net.Addr) int { - return AddrPort(addr) -} - func (cl *Client) peerHasAll(t *torrent, cn *connection) { cn.peerHasAll = true cn.PeerPieces = nil -- 2.48.1