Commit Graph

327 Commits

Author SHA1 Message Date
Matt Joiner 40b0f9ca1e cmd/torrent: Include download stats on interrupt 2021-09-20 21:33:46 +10:00
Matt Joiner 00a7300421 cmd/torrent: Dump download statistics 2021-09-20 14:17:58 +10:00
Matt Joiner baddf0e528 cmd/torrent: Use anacrolix/args and merge several other cmds in as subcommands 2021-09-15 10:54:14 +10:00
YenForYang a8db640c62
Drop bradfitz/iter dependency (#605)
* Drop bradfitz/iter dependency

`range iter.N` looks nice and doesn't allocate, but unfortunately using a `range` expression blocks a function from being inlined wherever it's used (for now). It's not that we need inlining in all cases, but I do think a C-style for loop looks just as nice and is probably clearer to the majority. There also aren't any clear disadvantages to changing (unless you just happen to dislike the look of C)

* Update misc_test.go

* Update rlreader_test.go

* Update torrent_test.go

* Update bench_test.go

* Update client_test.go

* Update iplist_test.go

* Update mse_test.go

* Update peerconn_test.go

* Update peerconn.go

* Update order_test.go

* Update decoder_test.go

* Update main.go

* Update bench-piece-mark-complete.go

* Update main.go

* Update torrent.go

* Update iplist_test.go

* Update main.go
2021-09-14 13:46:50 +10:00
YenForYang 1bb6724020
Remove xerrors dependency (#600)
* Remove xerrors dependency

* Update main.go
2021-09-13 11:38:08 +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 d8a6509728 ./cmd/torrent-create: Update the builtin announce list 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 555cb064dd cmd/torrentfs: Fix panic on missing info 2021-08-01 21:38:35 +10:00
Matt Joiner a570b83870 Update and expose default client identifiers 2021-06-25 11:29:59 +10:00
Matt Joiner c3c982b621 Fixes for wasm 2021-06-23 17:24:50 +10:00
Matt Joiner ad298364aa Add client-level max unverified bytes 2021-06-07 13:01:39 +10:00
Matt Joiner 8654f1b01d Move envpprof.Stop to main 2021-05-14 15:43:24 +10:00
Matt Joiner b9c36ebef3 cmd/torrent: Track download rate 2021-05-14 15:42:20 +10:00
Matt Joiner 8706d326ba cmd/torrent: Ensure progress is emitted at consistent intervals 2021-05-04 16:08:21 +10:00
Matt Joiner bb4fc82d4b cmd/torrent: Restore parsing of units for upload and download rates
https://github.com/anacrolix/torrent/issues/447
2021-05-04 16:00:22 +10:00
Matt Joiner 305ba51dc2 Big logging cleanup to improve experience from README 2021-05-04 12:44:51 +10:00
Matt Joiner 35464677ef Improve metainfo.MetaInfo.Magnet interface and add tests 2021-02-24 12:11:47 +11:00
ucwong 52bb7f7a39 connection drop log debug level 2021-01-07 00:21:59 +11:00
Matt Joiner 1e9d382af9 Reinstate cmd/announce announce subcommand 2021-01-04 13:37:44 +11:00
Matt Joiner 65db2436fd cmd/torrent: Add spew-bencoding command 2020-12-09 20:01:53 +11:00
Matt Joiner 143bf42f5e cmd/torrent: Fix download command default flags 2020-12-09 20:01:33 +11:00
Matt Joiner e67fe7ddca cmd/torrent: Add file pick flag 2020-12-09 20:00:42 +11:00
Matt Joiner 3178691f15 cmd/torrent: Use alexflint/go-arg for argument parsing
Also add list-files command to test it out.
2020-12-09 16:18:54 +11:00
Matt Joiner 6b5da26d38 Improve cmd/tracker-announce
Add -tracker flag, support specifying infohashes directly, spew announce responses so they're more readable.
2020-11-11 15:30:53 +11:00
Matt Joiner e6da640bb2 Tidy up doc, file names, naming 2020-11-09 10:56:45 +11:00
Matt Joiner 8088002ba6 Fix error handling for bad torrent adds with safe file handling 2020-10-15 16:03:43 +11:00
Matt Joiner fde583e51e Support -testPeer addresses that need resolving
Fixes #395.
2020-07-10 13:21:24 +10:00
Matt Joiner 72bd4f362e Add option to disable webseeds 2020-06-02 16:17:32 +10:00
Matt Joiner 67c9021e97 Support disabling webtorrent 2020-06-01 18:24:46 +10:00
Matt Joiner cf6d161256 cmd/torrent-verify: Fix piece hash output 2020-06-01 11:16:17 +10:00
Matt Joiner 3cbdf4aa98 cmd/torrent-verify now needs to call InitIndex 2020-06-01 00:04:15 +10:00
Matt Joiner cb37a914c1 Rename Peer to PeerInfo, and unexport PeerInfos 2020-05-29 19:44:48 +10:00
Yaroslav Kolomiiets 6ea0344efd torrent-metainfo-pprint: include the 'nodes' field into the output when non-empty 2020-05-21 16:31:14 +10:00
Matt Joiner a1a715f362 Improve cmd/tracker-announce output 2020-05-20 12:04:53 +10:00
Matt Joiner 533fec840a cmd/tracker-announce: Rework for better utility in shell scripts 2020-05-12 11:31:56 +10:00
Matt Joiner 11e13ac8c1 cmd/torrent: Output stats on termination, not just completion 2020-05-03 18:42:37 +10:00
Matt Joiner 90bbdf9adb cmd/torrent: Add download -pex flag
For testing with https://github.com/anacrolix/torrent/issues/402.
2020-05-03 18:42:03 +10:00
Matt Joiner 11a373200f cmd/torrent: Only output progress lines when they change
This stops spamming output when seeding.
2020-05-03 18:41:33 +10:00
Yaroslav Kolomiiets dad28e674e cmd/torrent: add -ipv4/-ipv6 options 2020-04-17 11:06:50 +10:00
Matt Joiner 8cf3ce187d cmd/torrent: Fix -{utp,tcp}Peers defaults
Addresses https://github.com/anacrolix/torrent/issues/396#issuecomment-614210103.
2020-04-16 10:26:37 +10:00
Matt Joiner 3e5c6d3d44 cmd/torrent: Add download -tcpPeers and -utpPeers 2020-04-11 13:03:41 +10:00
Matt Joiner d3b6bcef97 Add announce and download commands to cmd/torrent 2020-04-10 15:27:30 +10:00
ucwong c435d713c4 cmd/torrent-pick | add missing ticker.Stop() call 2020-04-03 17:02:16 +10:00
Matt Joiner 7fe199992c Use stable bit set for pending pieces PriorityBitmap
Fixes #382.
2020-02-27 18:33:44 +11:00
Matt Joiner 9fb9112d8f cmd/torrent: Ditch the progress bar
I'm not happy with any implementations. The one in use was racy anyway. Helps progress toward fixing #382.
2020-02-27 16:50:14 +11:00
Matt Joiner d24922dc09 Add support for non-IP-based networks
Includes a test with unix sockets. Exposes AddDialer, AddListener, and reworks Peer.
2020-02-20 16:47:37 +11:00
Matt Joiner bd4176f5ea cmd/torrent: Disable accept rate limiting 2020-01-04 17:16:48 +11:00
Matt Joiner 8323dd9a14 cmd/torrent: Move log setup earlier to avoid race 2020-01-04 16:41:18 +11:00
Matt Joiner 5746877e1d cmd/torrent: Synchronize stopping 2020-01-04 16:41:02 +11:00
Matt Joiner 01f9fdb921 Upgrade to log v0.5.0 2020-01-03 15:37:08 +11:00
Matt Joiner bfbed8ab6d cmd/torrent: Make the addr flag a string
This avoids tagflag trying to resolve it, and then passing a bad IP for different listen networks. There's also a patch to tagflag so it doesn't do this anymore.
2020-01-03 14:51:26 +11:00
Matt Joiner e24a9b343f cmd/torrent: Add dht flag 2020-01-03 14:51:26 +11:00
D. HT. Yu 6e95274413 fix if statement in `cmd/torrent/main.go` (#349) 2019-12-08 20:34:24 +11:00
Matt Joiner eb4dad73ae Lots of improvements to logging 2019-08-22 13:59:04 +10:00
Matt Joiner cb1bf0f413 goimports -local 2019-08-21 20:58:40 +10:00
Matt Joiner 09b587f17b Comments 2019-07-19 13:04:10 +10:00
Matt Joiner fb7293a94f cmd/torrent: Add flag for progress bar 2019-07-19 13:01:36 +10:00
Matt Joiner 93d34dd122 cmd/torrent: Don't log the public IP flag value 2019-07-19 13:00:31 +10:00
Matt Joiner 561e3915f3 cmd/torrent-magnet: Add a description to command help output 2019-07-17 18:12:54 +10:00
Matt Joiner 27b7fbe3f3 Fix announcing to S3 HTTP trackers 2019-07-17 18:12:11 +10:00
Matt Joiner 9afa2e70d7 cmd/torrent-metainfo-pprint: Fix -files for single-file torrents 2019-07-17 15:28:49 +10:00
Masih Yeganeh 72db8ae577 Adds more flags to torrent-create
Flags for setting Comment and CreatedBy fields and starting with empty AnnounceList
2019-03-01 11:18:57 +11:00
Matt Joiner ba9300e27e cmd/torrent: Add -publicIp flag 2019-01-08 15:47:01 +11:00
Matt Joiner fc4fab91f5 Switch to goimports import sorting
Used to use sortimports, but it's old, and goimports seems to have an opinion now.
2018-11-02 23:12:01 +11:00
Matt Joiner ad0c33a50c Fix TLS handshake failures with https trackers
Fixes #276
2018-10-18 11:09:56 +11:00
Matt Joiner 3ae66f3693 cmd/tracker-announce: Add a port flag 2018-08-13 20:27:42 +10:00
Matt Joiner 975fa8f143 cmd/tracker-announce: Provide a http.Client for announces 2018-08-13 20:27:16 +10:00
Matt Joiner 8b4a4193a8 cmd/tracker-announce: Was using empty AnnounceRequest 2018-08-13 20:26:47 +10:00
jb 5a09866db4 attempt to close the client on signal 2018-07-24 09:34:06 +02:00
Matt Joiner a7e338a3f1 More sortimports 2018-07-07 11:40:06 +10:00
Matt Joiner 2b1068885c cmd/torrent-metainfo-pprint: Use bufio input and enable envpprof 2018-06-17 16:20:02 +10:00
Matt Joiner cee8e3b9f9 Update external use of ClientConfig 2018-06-16 16:33:40 +10:00
Matt Joiner 37fc800cb1 cmd/torrent: Add -stats flag
Requires updated tagflag package.
2018-06-06 00:40:03 +10:00
Matt Joiner b5df073217 Support different hosts for each network
CircleCI's localhost hostname doesn't resolve for IPv6.
2018-04-12 15:06:53 +10:00
Matt Joiner 319e57d1c6 Rework conns to/and allow multiple DHT servers
This will help with #229, and IPv6 support.
2018-04-12 11:41:07 +10:00
Matt Joiner 5a7c4fc135 cmd/torrent: Add packed-blocklist flag 2018-02-19 16:20:31 +11:00
Matt Joiner 7a7f468d9d cmd/tracker-announce: Rework to be faster and support UDP IPv6 2018-02-19 16:20:08 +11:00
Matt Joiner 358c6c8649 cmd/torrent: Fix logging when progress bar and stderr are the same file 2018-01-25 13:12:46 +11:00
Matt Joiner ddd1e90d45 Fix cmd/torrent -debug 2018-01-25 13:11:32 +11:00
Matt Joiner 0b553b296f Add File priorities
Fixes #220.
2018-01-21 22:49:12 +11:00
Matt Joiner 2f616b9d8b megacheck and staticcheck fixes 2018-01-06 16:53:40 +11:00
Matt Joiner 7b668237bc cmd/torrent-pick: Close file Reader 2018-01-06 16:41:05 +11:00
Matt Joiner 9b718566ba Add File.NewReader
Fixes #222
2018-01-06 16:37:13 +11:00
Denis Kuzmenok 455a414204 adding http user-agent setters and usage 2017-12-28 10:47:51 +02:00
Matt Joiner 4190856b6c sortimports 2017-12-01 18:12:29 +11:00
Matt Joiner 8f7720edb2 Merge commit '6ab65a49a8a72dea1a28968b2ab42a85fd4566ec'
# Conflicts:
#	config.go
2017-11-08 20:23:15 +11:00
Matt Joiner f960ec1b65 cmd/torrent-metainfo-pprint: Just take a single metainfo to stdin
Move processing into its own function too.
2017-11-08 19:33:05 +11:00
themihai 6ab65a49a8 feat(config): Allows the torrent client to customise the client identity and connection config 2017-11-07 20:14:13 +02:00
Matt Joiner 2ab850f56e cmd/torrent-metainfo-pprint: Include metainfo's url-list in output
Helps with testing #197.
2017-10-14 16:41:14 +11:00
Matt Joiner 881f1a7e35 Support plaintext crypto method for protocol header encryption 2017-09-13 18:20:20 +10:00
Matt Joiner 016b238cc5 cmd/torrent: Enhance debugging 2017-09-01 10:35:40 +10:00
Matt Joiner 756375879b cmd/torrent: Include global dht starting nodes 2017-08-28 20:54:37 +10:00
Matt Joiner 4ffcd9f1ce cmd/torrentfs: Switch to tagflag and rename -torrentPath->-metainfoDir 2017-08-27 12:25:51 +10:00
Matt Joiner 6268fa0b54 cmd/magnet-metainfo: Use tagflag 2017-08-27 11:46:06 +10:00
Matt Joiner dfb7f5b00c Make cmd/tracker-announce output a bit easier to consume 2017-08-26 12:38:08 +10:00
Matt Joiner 401974dd8d dht.ServerConfig.StartingNodes is now a function
Additionally cmd/torrentfs uses the global bootstrap nodes for its DHT. Aids with https://github.com/anacrolix/torrent/issues/180
2017-08-25 16:28:27 +10:00
Matt Joiner 89f39b0b09 Add some debugging routes and envpprof to cmd/magnet-metainfo
https://github.com/anacrolix/torrent/issues/178
2017-08-18 11:14:57 +10:00
Matt Joiner 99b3f98e3e Remove dht cmds, they're added to anacrolix/dht 2017-07-21 00:39:28 +10:00
Matt Joiner 78a8db10da sortimports 2017-03-19 17:04:32 +11:00