]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Align webtorrent tracker to BEP-3
authorJustin M <37273682+DigitalAlchemist@users.noreply.github.com>
Mon, 4 Jan 2021 22:54:07 +0000 (22:54 +0000)
committerMatt Joiner <anacrolix@gmail.com>
Tue, 5 Jan 2021 00:38:39 +0000 (11:38 +1100)
Adding "omitempty" to json marshalling, bringing the webtorrent tracker AnnounceRequest in line
with BEP-3, which states omitting the the "event" field is acceptable.

webtorrent/tracker_protocol.go

index 167044a6315510e833634c0b9fcb1d93f95787f6..a63fe5a64d3cd470d81bf4a38ac05bad95ee2256 100644 (file)
@@ -12,7 +12,7 @@ type AnnounceRequest struct {
        Uploaded   int64   `json:"uploaded"`
        Downloaded int64   `json:"downloaded"`
        Left       int64   `json:"left"`
-       Event      string  `json:"event"`
+       Event      string  `json:"event,omitempty"`
        Action     string  `json:"action"`
        InfoHash   string  `json:"info_hash"`
        PeerID     string  `json:"peer_id"`