]> Sergey Matveev's repositories - btrtrc.git/commitdiff
gorond
authorMatt Joiner <anacrolix@gmail.com>
Tue, 27 Feb 2024 06:29:17 +0000 (17:29 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Tue, 27 Feb 2024 06:29:17 +0000 (17:29 +1100)
14 files changed:
client.go
internal/cmd/issue-906/main.go
ltep.go
ltep_test.go
peer_protocol/reserved_test.go
peerconn_test.go
request-strategy/piece-request-order.go
smartban/smartban.go
smartban_test.go
socket.go
storage/piece-resource.go
storage/possum/possum-provider.go
storage/possum/possum_test.go
torrent-piece-request-order.go

index e2f1de31aa032061c14c1b6b23cc5ea287842c89..938bd5f30649b9ed5da7ff702da118dc1d325bcc 100644 (file)
--- a/client.go
+++ b/client.go
@@ -9,7 +9,6 @@ import (
        "errors"
        "expvar"
        "fmt"
-       "github.com/cespare/xxhash"
        "io"
        "math"
        "net"
@@ -31,6 +30,7 @@ import (
        "github.com/anacrolix/missinggo/v2/bitmap"
        "github.com/anacrolix/missinggo/v2/pproffd"
        "github.com/anacrolix/sync"
+       "github.com/cespare/xxhash"
        "github.com/davecgh/go-spew/spew"
        "github.com/dustin/go-humanize"
        gbtree "github.com/google/btree"
index 7c3bdc1780337bbb7765292e1c2c476d93cae23b..41c8c58426b7fc26d572c56ab6fcd936606f5493 100644 (file)
@@ -6,6 +6,7 @@ import (
        "os"
 
        _ "github.com/anacrolix/envpprof"
+
        "github.com/anacrolix/torrent"
 )
 
diff --git a/ltep.go b/ltep.go
index 747d8086fb6ed6cececdd4707eb70673340cd06e..cde0378413cecd290cd8890f3b47c47cc1bf299a 100644 (file)
--- a/ltep.go
+++ b/ltep.go
@@ -5,6 +5,7 @@ import (
        "slices"
 
        g "github.com/anacrolix/generics"
+
        pp "github.com/anacrolix/torrent/peer_protocol"
 )
 
index c3c874ceca28e8e19511c4a440c6a1c4c28afa96..0a95a86837853d0b8f088d958dfb28ed1e83d6ca 100644 (file)
@@ -4,15 +4,12 @@ import (
        "strconv"
        "testing"
 
-       pp "github.com/anacrolix/torrent/peer_protocol"
-
-       qt "github.com/frankban/quicktest"
-
-       "github.com/anacrolix/torrent/internal/testutil"
-
        "github.com/anacrolix/sync"
+       qt "github.com/frankban/quicktest"
 
        . "github.com/anacrolix/torrent"
+       "github.com/anacrolix/torrent/internal/testutil"
+       pp "github.com/anacrolix/torrent/peer_protocol"
 )
 
 const (
index 8ee3a722779c15cd1ace08eb6fe5fd140c770c62..53f9d86d92af00f7cfd726115c3b78b6070b0d3c 100644 (file)
@@ -1,8 +1,9 @@
 package peer_protocol
 
 import (
-       qt "github.com/frankban/quicktest"
        "testing"
+
+       qt "github.com/frankban/quicktest"
 )
 
 func TestV2BitLocation(t *testing.T) {
index 36327800164388946d1dbcf990754b6d095c41ee..70f9017bb09227e8c7880b033aab586d3dd445df 100644 (file)
@@ -4,13 +4,13 @@ import (
        "encoding/binary"
        "errors"
        "fmt"
-       g "github.com/anacrolix/generics"
        "io"
        "net"
        "net/netip"
        "sync"
        "testing"
 
+       g "github.com/anacrolix/generics"
        "github.com/frankban/quicktest"
        qt "github.com/frankban/quicktest"
        "github.com/stretchr/testify/require"
index 54b5a6ee995ffc7dce73cf930bcc8c4613d16e64..0e2797726a5bd820d30a40c961f29b57ddb51567 100644 (file)
@@ -2,6 +2,7 @@ package requestStrategy
 
 import (
        g "github.com/anacrolix/generics"
+
        "github.com/anacrolix/torrent/metainfo"
 )
 
index ba568c98d041b4eb38408f69f4c77cc398bbe889..1910d7d5a2ff4027160cebafb586eeded4e94542 100644 (file)
@@ -1,8 +1,9 @@
 package smartban
 
 import (
-       g "github.com/anacrolix/generics"
        "sync"
+
+       g "github.com/anacrolix/generics"
 )
 
 type Cache[Peer, BlockKey, Hash comparable] struct {
index 2947f521697fb34fea867f3b8017615b3582dc7b..0f8e8d917a60f6463450ee8b4dc2e814d12ad23c 100644 (file)
@@ -2,11 +2,13 @@ package torrent
 
 import (
        "crypto/sha1"
-       "github.com/anacrolix/missinggo/v2/iter"
-       "github.com/anacrolix/torrent/smartban"
-       "github.com/cespare/xxhash"
        "net/netip"
        "testing"
+
+       "github.com/anacrolix/missinggo/v2/iter"
+       "github.com/cespare/xxhash"
+
+       "github.com/anacrolix/torrent/smartban"
 )
 
 func benchmarkSmartBanRecordBlock[Sum comparable](b *testing.B, hash func([]byte) Sum) {
index 0f45dcbae796a5bbb21d2945d6ce25edd4116af1..18c8b86034f1a482cc8fdee49368614d834de106 100644 (file)
--- a/socket.go
+++ b/socket.go
@@ -4,12 +4,12 @@ import (
        "context"
        "errors"
        "fmt"
-       g "github.com/anacrolix/generics"
        "net"
        "os"
        "strconv"
        "syscall"
 
+       g "github.com/anacrolix/generics"
        "github.com/anacrolix/log"
        "github.com/anacrolix/missinggo/perf"
        "github.com/anacrolix/missinggo/v2"
index a891e9d246af0e0b94dc610e87229830ca47a424..9e3e63e7fa6bd75c004ed630acb7a9ee18ca1fa6 100644 (file)
@@ -3,13 +3,13 @@ package storage
 import (
        "bytes"
        "fmt"
-       "github.com/anacrolix/sync"
        "io"
        "path"
        "sort"
        "strconv"
 
        "github.com/anacrolix/missinggo/v2/resource"
+       "github.com/anacrolix/sync"
 
        "github.com/anacrolix/torrent/metainfo"
 )
index e67cdada48b134bf3d86ff314e51b3d3992d9ca4..fd7810d317e35f054414a4762ef7725255a622a8 100644 (file)
@@ -5,13 +5,15 @@ package possumTorrentStorage
 import (
        "cmp"
        "fmt"
+       "io"
+       "sort"
+       "strconv"
+
        "github.com/anacrolix/log"
        possum "github.com/anacrolix/possum/go"
        possumResource "github.com/anacrolix/possum/go/resource"
+
        "github.com/anacrolix/torrent/storage"
-       "io"
-       "sort"
-       "strconv"
 )
 
 // Extends possum resource.Provider with an efficient implementation of torrent
index 6bd350b1dc5866d3c368335ee0dda59ba8be715c..1c0e81105db25851e47c43649495e2e397569337 100644 (file)
@@ -1,13 +1,15 @@
 package possumTorrentStorage
 
 import (
+       "testing"
+
        g "github.com/anacrolix/generics"
        "github.com/anacrolix/log"
        possum "github.com/anacrolix/possum/go"
        possumResource "github.com/anacrolix/possum/go/resource"
+
        "github.com/anacrolix/torrent/storage"
        test_storage "github.com/anacrolix/torrent/storage/test"
-       "testing"
 )
 
 // This should be made to mirror the benchmarks for sqlite storage.
index 03943ed04a1d71445925d82584afafa353d32484..b2bde8dc9e9cd4236462db3652bcc3ae3c247e52 100644 (file)
@@ -2,6 +2,7 @@ package torrent
 
 import (
        g "github.com/anacrolix/generics"
+
        request_strategy "github.com/anacrolix/torrent/request-strategy"
 )