From ed75065f76264e40e29b8e8877b405baf4b4551a Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Thu, 12 Apr 2018 16:12:14 +1000 Subject: [PATCH] Reinstate Uploaded and Downloaded values in tracker announces Fixes followup comment in #71. --- torrent.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/torrent.go b/torrent.go index 83b6546b..bc3f2a08 100644 --- a/torrent.go +++ b/torrent.go @@ -1325,14 +1325,22 @@ func (t *Torrent) startMissingTrackerScrapers() { // Returns an AnnounceRequest with fields filled out to defaults and current // values. func (t *Torrent) announceRequest() tracker.AnnounceRequest { + // Note that IPAddress is not set. It's set for UDP inside the tracker + // code, since it's dependent on the network in use. return tracker.AnnounceRequest{ Event: tracker.None, NumWant: -1, Port: uint16(t.cl.incomingPeerPort()), PeerId: t.cl.peerID, InfoHash: t.infoHash, - Left: t.bytesLeftAnnounce(), Key: t.cl.announceKey(), + + // The following are vaguely described in BEP 3. + + Left: t.bytesLeftAnnounce(), + Uploaded: t.stats.BytesWrittenData, + // There's no mention of wasted or unwanted download in the BEP. + Downloaded: t.stats.BytesReadUsefulData, } } -- 2.50.0