Add some extra char flags to connection status

This commit is contained in:
Matt Joiner 2014-07-10 00:16:09 +10:00
parent 2ef602cabd
commit 5f9ed81917
1 changed files with 10 additions and 1 deletions

View 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')
}