From: Matt Joiner Date: Wed, 9 Jul 2014 14:16:09 +0000 (+1000) Subject: Add some extra char flags to connection status X-Git-Tag: v1.0.0~1680 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=5f9ed819170c4df20b26de991ac2c29ef11cd32c;p=btrtrc.git Add some extra char flags to connection status --- diff --git a/connection.go b/connection.go index 91d5b327..10e84d02 100644 --- a/connection.go +++ b/connection.go @@ -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') }