]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Add some extra char flags to connection status
authorMatt Joiner <anacrolix@gmail.com>
Wed, 9 Jul 2014 14:16:09 +0000 (00:16 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Wed, 9 Jul 2014 14:16:09 +0000 (00:16 +1000)
connection.go

index 91d5b327451cd8938165bdb0e7633f0edb8e829b..10e84d0259d08fd283ac69161803182fa6deb24f 100644 (file)
@@ -66,11 +66,20 @@ func (cn *connection) WriteStatus(w io.Writer) {
                fmt.Fprintf(w, "%c", b)
        }
        // https://trac.transmissionbt.com/wiki/PeerStatusText
+       if cn.PeerInterested && !cn.Choked {
+               c('O')
+       }
        if len(cn.Requests) != 0 {
                c('D')
-       } else if cn.Interested {
+       }
+       if cn.PeerChoked && cn.Interested {
                c('d')
        }
+       if !cn.Choked && cn.PeerInterested {
+               c('U')
+       } else {
+               c('u')
+       }
        if !cn.PeerChoked && !cn.Interested {
                c('K')
        }