]> Sergey Matveev's repositories - btrtrc.git/blobdiff - tracker/udp.go
Standardize on krpc types, and extend PEX message type for IPv6
[btrtrc.git] / tracker / udp.go
index 07c7f0ae2d0d19a9c38442f8745483b499dcf625..0302a4e8a8be963b6e89673d7ec4086c91629a9e 100644 (file)
@@ -11,10 +11,9 @@ import (
        "net/url"
        "time"
 
+       "github.com/anacrolix/dht/krpc"
        "github.com/anacrolix/missinggo"
        "github.com/anacrolix/missinggo/pproffd"
-
-       "github.com/anacrolix/torrent/util"
 )
 
 type Action int32
@@ -115,7 +114,8 @@ func (c *udpAnnounce) Do(req *AnnounceRequest) (res AnnounceResponse, err error)
        res.Interval = h.Interval
        res.Leechers = h.Leechers
        res.Seeders = h.Seeders
-       cps, err := util.UnmarshalIPv4CompactPeers(b.Bytes())
+       var cps krpc.CompactIPv4NodeAddrs
+       err = cps.UnmarshalBinary(b.Bytes())
        if err != nil {
                return
        }