]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Update anacrolix/generics v1.45.0
authorMatt Joiner <anacrolix@gmail.com>
Mon, 20 Jun 2022 01:37:25 +0000 (11:37 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Mon, 20 Jun 2022 22:51:33 +0000 (08:51 +1000)
go.mod
go.sum
peerconn.go
t.go
torrent.go

diff --git a/go.mod b/go.mod
index bf6439db919ae60b00dc717d7590aea037e1eacc..a23fd1ab36d84d426e75bbcbbd6e0f6ff151a2e3 100644 (file)
--- a/go.mod
+++ b/go.mod
@@ -12,7 +12,7 @@ require (
        github.com/anacrolix/dht/v2 v2.16.2-0.20220311024416-dd658f18fd51
        github.com/anacrolix/envpprof v1.2.1
        github.com/anacrolix/fuse v0.2.0
-       github.com/anacrolix/generics v0.0.0-20220510042907-b50562b436ec
+       github.com/anacrolix/generics v0.0.0-20220618083756-f99e35403a60
        github.com/anacrolix/go-libutp v1.2.0
        github.com/anacrolix/log v0.13.1
        github.com/anacrolix/missinggo v1.3.0
diff --git a/go.sum b/go.sum
index 99a8cad6d7f4a3992bee934a8db94b706e4a6970..9b257b75a2e3bfae741b57960a5c33ec8abec92e 100644 (file)
--- a/go.sum
+++ b/go.sum
@@ -39,8 +39,8 @@ github.com/anacrolix/envpprof v1.2.1 h1:25TJe6t/i0AfzzldiGFKCpD+s+dk8lONBcacJZB2
 github.com/anacrolix/envpprof v1.2.1/go.mod h1:My7T5oSqVfEn4MD4Meczkw/f5lSIndGAKu/0SM/rkf4=
 github.com/anacrolix/fuse v0.2.0 h1:pc+To78kI2d/WUjIyrsdqeJQAesuwpGxlI3h1nAv3Do=
 github.com/anacrolix/fuse v0.2.0/go.mod h1:Kfu02xBwnySDpH3N23BmrP3MDfwAQGRLUCj6XyeOvBQ=
-github.com/anacrolix/generics v0.0.0-20220510042907-b50562b436ec h1:OnHX2MpnlLBBee06jcpL6eBppz766BnquXnZKH6iGgI=
-github.com/anacrolix/generics v0.0.0-20220510042907-b50562b436ec/go.mod h1:ff2rHB/joTV03aMSSn/AZNnaIpUw0h3njetGsaXcMy8=
+github.com/anacrolix/generics v0.0.0-20220618083756-f99e35403a60 h1:k4/h2B1gGF+PJGyGHxs8nmHHt1pzWXZWBj6jn4OBlRc=
+github.com/anacrolix/generics v0.0.0-20220618083756-f99e35403a60/go.mod h1:ff2rHB/joTV03aMSSn/AZNnaIpUw0h3njetGsaXcMy8=
 github.com/anacrolix/go-libutp v1.2.0 h1:sjxoB+/ARiKUR7IK/6wLWyADIBqGmu1fm0xo+8Yy7u0=
 github.com/anacrolix/go-libutp v1.2.0/go.mod h1:RrJ3KcaDcf9Jqp33YL5V/5CBEc6xMc7aJL8wXfuWL50=
 github.com/anacrolix/log v0.3.0/go.mod h1:lWvLTqzAnCWPJA08T2HCstZi0L1y2Wyvm3FJgwU9jwU=
index c58745e2dce00c5d1181018fc74b7c4c083c52bc..989b2f816a6398ebe9e41fa1e3718c4a676f376b 100644 (file)
@@ -366,7 +366,7 @@ func (cn *Peer) iterContiguousPieceRequests(f func(piece pieceIndex, count int))
                        count++
                } else {
                        if count != 0 {
-                               f(last.Value(), count)
+                               f(last.Value, count)
                        }
                        last = item
                        count = 1
@@ -1400,8 +1400,8 @@ func (c *Peer) receiveChunk(msg *pp.Message) error {
        req := c.t.requestIndexFromRequest(ppReq)
        t := c.t
 
-       if c.bannableAddr.Ok() {
-               t.smartBanCache.RecordBlock(c.bannableAddr.Value(), req, msg.Piece)
+       if c.bannableAddr.Ok {
+               t.smartBanCache.RecordBlock(c.bannableAddr.Value, req, msg.Piece)
        }
 
        if c.peerChoking {
diff --git a/t.go b/t.go
index a20e02c869f50453da296df548795d29ae909150..de7965dc5be2bbe0e0cd534dae2017fac6a93122 100644 (file)
--- a/t.go
+++ b/t.go
@@ -147,7 +147,7 @@ func (t *Torrent) Name() string {
 // The completed length of all the torrent data, in all its files. This is
 // derived from the torrent info, when it is available.
 func (t *Torrent) Length() int64 {
-       return t._length.Value()
+       return t._length.Value
 }
 
 // Returns a run-time generated metainfo for the torrent that includes the
index c8606ad82ccbf2f47aade00c8e3198bff4d71deb..7ce097fa6256cb84c8fb5e83c492c7a2857c125f 100644 (file)
@@ -168,7 +168,7 @@ type Torrent struct {
 }
 
 func (t *Torrent) length() int64 {
-       return t._length.Value()
+       return t._length.Value
 }
 
 func (t *Torrent) selectivePieceAvailabilityFromPeers(i pieceIndex) (count int) {
@@ -2157,7 +2157,7 @@ func (t *Torrent) dropBannedPeers() {
        t.iterPeers(func(p *Peer) {
                remoteIp := p.remoteIp()
                if remoteIp == nil {
-                       if p.bannableAddr.Ok() {
+                       if p.bannableAddr.Ok {
                                t.logger.WithDefaultLevel(log.Debug).Printf("can't get remote ip for peer %v", p)
                        }
                        return