From: Matt Joiner Date: Mon, 22 Jun 2015 09:46:26 +0000 (+1000) Subject: Print peer IDs as escaped ascii X-Git-Tag: v1.0.0~1148 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=859129fb28d4cbc296d5e7c7ca794be7d4f13691;p=btrtrc.git Print peer IDs as escaped ascii --- 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),