]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Print peer IDs as escaped ascii
authorMatt Joiner <anacrolix@gmail.com>
Mon, 22 Jun 2015 09:46:26 +0000 (19:46 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Mon, 22 Jun 2015 09:46:26 +0000 (19:46 +1000)
client.go
connection.go

index 2c9d522e33e1b5c8f1426322e377f19ae41e1494..567c78e08f9022b378ca63cd0a65e0f99b183d3b 100644 (file)
--- 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)
index a57462b3dcae273ece65a8920a12566cd4c2033d..c4f8b165f6e7c2007c4077206d59c9d671ec330c 100644 (file)
@@ -236,7 +236,7 @@ func (cn *connection) statusFlags() (ret string) {
 
 func (cn *connection) WriteStatus(w io.Writer, t *torrent) {
        // \t isn't preserved in <pre> 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),