Commit Graph

2819 Commits

Author SHA1 Message Date
Matt Joiner 6d560b8902
Update README.md 2021-09-08 13:45:25 +10:00
YenForYang 719505a138
Drop xerrors and missinggo/slices dependency for Client (#572)
* Drop xerrors and missinggo/slices dependency for Client

Made `BadPeerIPs` inlineable since I changed `badPeerIPsLocked` anyway. Also eliminated an extra torrentsAsSlice copy since Go wasn't smart enough to figure it out.
2021-09-08 09:34:06 +10:00
Zilog8 ccb90f1252
Improve Closing (#559)
- Prevent double-closing in cmd/torrent
- Move async closing from storage to torrents, and wait on them to finish tidying up before returning/exiting.
2021-09-05 11:33:41 +10:00
Matt Joiner f295057347 Update chansync 2021-09-04 23:34:06 +10:00
Matt Joiner ad70dcdbf4 Return error on sqlite PieceCompletion.Set when closed 2021-09-04 23:07:32 +10:00
Matt Joiner 175b826e73 Rework Reader waiting 2021-09-04 23:07:32 +10:00
YenForYang f86355ac0b Simplify dhtPort()
A similar case of `haveDhtServer`
2021-09-04 23:04:06 +10:00
YenForYang 99ba75f458 Drop xerrors and reflection dependency
Nothing wrong with missinggo.CopyExact -- but fewer dependencies is better IMO.  Also changed String() to use a consistent receiver name -- not a big deal.
2021-09-04 23:01:37 +10:00
afjoseph c76bb42c07 [gomod] Update anacrolix/dht and run 'go mod tidy' 2021-09-04 21:21:52 +10:00
YenForYang d1c0b95a9c Simplify haveDhtServers()
A bit too much functional programming, lol.
2021-09-03 20:41:01 +10:00
Matt Joiner d4c3a690ab Merge branch 'master' into squirrel 2021-09-02 14:19:29 +10:00
Matt Joiner 30e8d1ae74 go get -u ./... 2021-09-02 10:31:47 +10:00
Matt Joiner b4a66a3ca7 Add generics TODO 2021-09-02 10:22:32 +10:00
Matt Joiner e417c19a74 Add "no name" handling and storage.NewFileOpts
This came out of testing against Transmission in https://github.com/anacrolix/torrent/discussions/556#discussioncomment-1263670.
2021-09-02 10:22:32 +10:00
Matt Joiner d8a6509728 ./cmd/torrent-create: Update the builtin announce list 2021-09-02 10:22:32 +10:00
Matt Joiner aa3b864426 Fix info name when building from . and .. 2021-09-02 10:22:32 +10:00
Matt Joiner 62911fd656 cmd/torrent download: Don't seed if no torrents are specified 2021-09-02 10:22:32 +10:00
Matt Joiner 23029571ec Fix panic on double Close of sqlite piece completion DB 2021-09-02 10:22:32 +10:00
YenForYang cce8c150c2 PieceStateRuns: reduce copying and make inlineable
Just a heads up: using `range` and/or `defer` prevents function inlining. This is fine for infrequently called functions and/or large functions, but for simple public methods like these, I'd assume it's better for them to be inlined.
2021-09-01 14:51:45 +10:00
Matt Joiner bf6e64a652 Fix some DeepSource lints 2021-08-30 11:48:34 +10:00
Matt Joiner a0ec0f2708 Set Go CI workflow to use Go 1.17 2021-08-30 11:19:16 +10:00
Matt Joiner f838cda49f go mod tidy 2021-08-26 11:20:52 +10:00
Matt Joiner cf6c20d306 Add function to wrap squirrel.Cache as storage.ClientImpl 2021-08-26 11:20:37 +10:00
Matt Joiner 91873addfa Update squirrel 2021-08-26 11:19:39 +10:00
Matt Joiner d6fcf7a32a Use separate squirrel module 2021-08-25 14:37:00 +10:00
Matt Joiner 19d5905b6c Removed unused sqlite "provider" storage 2021-08-25 12:35:07 +10:00
Matt Joiner 8df24008ea Embed SQL 2021-08-24 22:24:39 +10:00
Matt Joiner 08d2dea5b4 Implement {Set,Get}Tag on SquirrelBlob 2021-08-24 18:37:38 +10:00
Matt Joiner f2f541a46b Begin extracting 'squirrel' from storage/sqlite 2021-08-24 17:52:31 +10:00
Matt Joiner 9b6e191b0a Avoid reallocating keep alive timer on each pass 2021-08-22 20:05:53 +10:00
Matt Joiner 4a1de735fa Don't run linter on master branch
Super unimpressed with this pedantic rubbish. PRs to adjust the settings welcome.
2021-08-22 17:00:06 +10:00
Matt Joiner 311c5bbb35
Update install command 2021-08-22 15:52:35 +10:00
Matt Joiner 5bcce95bbf Change linter workflow branches and name 2021-08-19 16:12:28 +10:00
Matt Joiner 72c74f7800 Remove unused code 2021-08-19 16:06:46 +10:00
Matt Joiner 5cfe54251a Update staticcheck go target to 1.16 2021-08-19 16:06:24 +10:00
Matt Joiner 3d03438480 Disable excessively pedantic linters 2021-08-19 16:05:58 +10:00
Matt Joiner 6b03f00093 Fix data race closing incoming PeerConn 2021-08-19 13:37:00 +10:00
Matt Joiner 8a65ef627d Set direct sqlite storage conn to nil on close
This might help catch the reason for SQLITE_MISUSE in getCapacity.
2021-08-19 13:37:00 +10:00
Matt Joiner 092dc74458 Rewrite peerConnMsgWriter.run 2021-08-19 13:37:00 +10:00
Matt Joiner 8f187411cc Set testing keep alive timeout to 1 millisecond
If it's too fast, we get stuck trying to send keep alives rather than actually communicating with the peer.
2021-08-19 13:37:00 +10:00
Matt Joiner 16c4b08885 Fix deadlock when checking whether to send keep alive 2021-08-19 13:37:00 +10:00
Matt Joiner a3c2d76b4a Limit keep alives for rate limited download test 2021-08-19 13:37:00 +10:00
Matt Joiner 588a7b6149 Fix race in assigning keep alive timer 2021-08-19 13:37:00 +10:00
Matt Joiner dcb2e5b53b Use different keep alive timeout in tests
Exposes bug found in email discussions resulting from https://github.com/anacrolix/torrent/discussions/547.
2021-08-19 13:37:00 +10:00
Bora M. Alper 16176b762e
Add linter CI (#542)
* Add linter CI

Signed-off-by: Bora M. Alper <bora@boramalper.org>

* Make gosec CI ignore SHA1 and upload sarif

Signed-off-by: Bora M. Alper <bora@boramalper.org>

* Fix formatting of source files

Signed-off-by: Bora M. Alper <bora@boramalper.org>

* Make go vet ignore unkeyed composite literals and fix other warnings

Signed-off-by: Bora M. Alper <bora@boramalper.org>

* Make staticcheck ignore unused methods and fix other warnings

Signed-off-by: Bora M. Alper <bora@boramalper.org>

* Use golangci-lint

Signed-off-by: Bora M. Alper <bora@boramalper.org>
2021-08-16 11:11:31 +10:00
Matt Joiner 22c5a94a6a Use roaring.Bitmap directly for completed pieces
Looking at improving the performance around this per https://github.com/anacrolix/torrent/discussions/547#discussion-3522317.
2021-08-16 11:07:10 +10:00
Matt Joiner cc0abf4fd2 Set go 1.17 in go.mod 2021-08-16 10:38:43 +10:00
Matt Joiner 909b2bb4b5 go get -u 2021-08-16 10:37:19 +10:00
Matt Joiner 450e8b0f7d Fix mmap panic on darwin with Go 1.17 2021-08-13 14:02:37 +10:00
Matt Joiner 901a8b1b36 Don't panic on int parse failures
This means for UnmarshalTypeErrors we now include context. There are still some other error types remaining that are thrown up via panic.
2021-08-12 13:46:02 +10:00