2
0
mirror of synced 2025-02-24 14:48:27 +00:00

Include trackers in WriteStatus

This commit is contained in:
Matt Joiner 2014-11-21 00:07:42 -06:00
parent 1942d5b73b
commit 9c37205dde

View File

@ -319,6 +319,13 @@ func (t *torrent) WriteStatus(w io.Writer) {
fmt.Fprintf(w, "%c", t.pieceStatusChar(index)) fmt.Fprintf(w, "%c", t.pieceStatusChar(index))
} }
fmt.Fprintln(w) fmt.Fprintln(w)
fmt.Fprintf(w, "Trackers: ")
for _, tier := range t.Trackers {
for _, tr := range tier {
fmt.Fprintf(w, "%q ", tr.String())
}
}
fmt.Fprintf(w, "\n")
fmt.Fprintf(w, "Pending peers: %d\n", len(t.Peers)) fmt.Fprintf(w, "Pending peers: %d\n", len(t.Peers))
fmt.Fprintf(w, "Half open: %d\n", len(t.HalfOpen)) fmt.Fprintf(w, "Half open: %d\n", len(t.HalfOpen))
fmt.Fprintf(w, "Active peers: %d\n", len(t.Conns)) fmt.Fprintf(w, "Active peers: %d\n", len(t.Conns))