From 859129fb28d4cbc296d5e7c7ca794be7d4f13691 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Mon, 22 Jun 2015 19:46:26 +1000 Subject: [PATCH] Print peer IDs as escaped ascii --- client.go | 2 +- connection.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client.go b/client.go index 2c9d522e..567c78e0 100644 --- a/client.go +++ b/client.go @@ -208,7 +208,7 @@ func (cl *Client) WriteStatus(_w io.Writer) { } else { fmt.Fprintln(w, "Not listening!") } - fmt.Fprintf(w, "Peer ID: %q\n", cl.peerID) + fmt.Fprintf(w, "Peer ID: %+q\n", cl.peerID) if cl.dHT != nil { dhtStats := cl.dHT.Stats() fmt.Fprintf(w, "DHT nodes: %d (%d good)\n", dhtStats.Nodes, dhtStats.GoodNodes) diff --git a/connection.go b/connection.go index a57462b3..c4f8b165 100644 --- a/connection.go +++ b/connection.go @@ -236,7 +236,7 @@ func (cn *connection) statusFlags() (ret string) { func (cn *connection) WriteStatus(w io.Writer, t *torrent) { // \t isn't preserved in
 blocks?
-	fmt.Fprintf(w, "%q: %s-%s\n", cn.PeerID, cn.localAddr(), cn.remoteAddr())
+	fmt.Fprintf(w, "%+q: %s-%s\n", cn.PeerID, cn.localAddr(), cn.remoteAddr())
 	fmt.Fprintf(w, "    last msg: %s, connected: %s, last useful chunk: %s\n",
 		eventAgeString(cn.lastMessageReceived),
 		eventAgeString(cn.completedHandshake),
-- 
2.48.1