Commit Graph

2259 Commits

Author SHA1 Message Date
Yaroslav Kolomiiets 93430aa01a PEX: add connection tracking 2020-04-15 17:24:44 +10:00
Yaroslav Kolomiiets 634edd2875 Share current connections with peers over PEX (anacrolix#341) 2020-04-15 17:24:44 +10:00
Craig Campbell 6920298770 Add Piece.UpdateCompletion() method
This should be all that is needed to handle pieces that are evicted or
removed from storage if you are using a storage implementation such as an LRU
cache.
2020-04-05 08:57:58 +10:00
ucwong c435d713c4 cmd/torrent-pick | add missing ticker.Stop() call 2020-04-03 17:02:16 +10:00
Matt Joiner 2c00258e70 Switch CI to go1.14 2020-03-29 11:38:25 +11:00
Matt Joiner 2ea04e9083 Use default bbolt package alias 2020-03-24 12:55:03 +11:00
Matt Joiner 7175dba614 Fix bbolt compatibility with go1.14 2020-03-24 12:55:03 +11:00
Alfonso Montero f7002cb860 Readme: Add downstream project 2020-03-24 11:30:15 +10:00
Matt Joiner 364d3dd208 Rewrite file.bytesLeft
Avoids iteration, and should handle files that are entirely inside a single piece, as well as zero-sized at the beginning of a torrent. Should fix #387.
2020-03-24 12:15:35 +11:00
Matt Joiner 4be8b12207 Rename variables in fileBytesLeft 2020-03-24 11:21:42 +11:00
Matt Joiner 3507ff1a69 Add abstraction and tests for #387 2020-03-24 11:19:11 +11:00
Matt Joiner 378ccd0932 Logging improvements for DHT 2020-03-17 13:48:09 +11:00
Matt Joiner c83738f3f4 Update to latest anacrolix/dht 2020-03-17 13:47:53 +11:00
Matt Joiner 4a5b891a34 Add doc comments related to #383 2020-03-16 16:30:39 +11: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 19ce53e69f Make io.EOF an expected error from storage.Piece.ReadAt
Fixes #381.
2020-02-27 16:45:57 +11:00
Matt Joiner ea71bf770c Expose PieceStateRun formatting 2020-02-27 16:42:33 +11:00
Matt Joiner 75e55a3e99 Add Piece.State 2020-02-27 16:41:33 +11:00
Matt Joiner 436da59801 Move requestStrategyDefaults into its own file 2020-02-27 09:45:13 +11:00
Matt Joiner bae791a5a2 Disable data downloading on storage write errors
Also add a hook and Torrent methods to modify this.
2020-02-22 19:40:50 +11:00
Matt Joiner ddc61845ac Misc cleanup 2020-02-22 19:38:56 +11:00
Matt Joiner b16118ee18 Add a test for storage write errors
Addresses #377
2020-02-21 14:56:21 +11:00
Matt Joiner c855c7a366 Differentiate between storage.ClientImpl{,Closer} 2020-02-21 14:12:44 +11:00
Matt Joiner 7d25cfdd1d Move envpprof imports around 2020-02-21 12:58:47 +11:00
Matt Joiner ddddc63924 Expose PeerConn.PeerPieces
Fixes #375.
2020-02-21 11:51:24 +11:00
Matt Joiner dff436f102 Rename connection->PeerConn and fix exports 2020-02-21 11:07:50 +11:00
Matt Joiner 01955ebe80 Tweak DHT status output 2020-02-21 09:47:46 +11:00
Matt Joiner afe4d8795d Support custom DHT servers
Addresses #266.
2020-02-20 17:46:29 +11:00
Matt Joiner 71f18f1042 Remove ClientConfig.ProxyURL and DefaultHTTPUserAgent
ProxyURL is no longer used for implicit sockets, this will ensure consumers are aware. It's other behaviour is already more correct specified through HTTPProxy.

DefaultHTTPUserAgent was vestigial, and is specified now through the ClientConfig.
2020-02-20 17:04:11 +11:00
Matt Joiner 3505d126d4 TestClientDisabledImplicitNetworksButDhtEnabled 2020-02-20 16:57:28 +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 0d4858ba29 Extract the transfer tests
We need them external the torrent package so we can test the API for adding dialers and listeners.
2020-02-20 13:57:24 +11:00
Matt Joiner e9e128cbf8 Split Client dialers and listeners 2020-02-20 11:10:05 +11:00
Matt Joiner 376ff763fe Apply staticcheck 2020-02-20 11:09:57 +11:00
Matt Joiner 1137956861 Remove funding file
It's drawn automatically from anacrolix/.github now.
2020-01-29 09:12:49 +11:00
Matt Joiner 466cced13a Make use of requestStrategyDefaults in more places 2020-01-24 19:24:28 +11:00
Matt Joiner 53e334d3f2 Move all the request strategy stuff into its file 2020-01-24 17:55:20 +11:00
Matt Joiner 538efd12bd Restore the default duplicate request timeout strategy 2020-01-24 17:34:07 +11:00
Matt Joiner 48eb7ff3f2 Expose request strategies 2020-01-24 17:30:57 +11:00
Matt Joiner 2044457959 Fix unimplemented hooks in request strategies one and two 2020-01-24 15:09:39 +11:00
Matt Joiner 737596d3df go get -u && go mod tidy 2020-01-23 14:16:46 +11:00
Matt Joiner 913f6df80d Use CopyN to ensure early io.EOF isn't ignored when hashing pieces 2020-01-23 13:56:39 +11:00
Matt Joiner 2c1afff8b3 Skip 1 frame in reader.log 2020-01-23 13:55:40 +11:00
Matt Joiner cf0d0118ea Finish fixing IP banning on storage errors 2020-01-23 13:54:37 +11:00
Matt Joiner 4fae1f81df Record connection dirtied piece before queuing for hash
Not a bug, but probably more robust.
2020-01-23 13:52:17 +11:00
Matt Joiner dc643d2ed3 Update code comments 2020-01-23 13:51:14 +11:00
Matt Joiner 1d5b8f7451 Reflow some comments 2020-01-22 15:56:16 +11:00
Matt Joiner dc39e98cfb Fix race in requestStrategyThree request timeout callback 2020-01-20 11:51:24 +11:00
Matt Joiner ff8ce944e9 Upgrade github.com/pkg/errors@v0.9.0 2020-01-14 15:42:27 +11:00