]>
Sergey Matveev's repositories - btrtrc.git/log
Matt Joiner [Wed, 9 Dec 2020 09:01:05 +0000 (20:01 +1100)]
Log announce return
Matt Joiner [Wed, 9 Dec 2020 09:00:42 +0000 (20:00 +1100)]
cmd/torrent: Add file pick flag
Matt Joiner [Wed, 9 Dec 2020 08:59:38 +0000 (19:59 +1100)]
Update github.com/anacrolix/dht/v2
Matt Joiner [Wed, 9 Dec 2020 05:18:54 +0000 (16:18 +1100)]
cmd/torrent: Use alexflint/go-arg for argument parsing
Also add list-files command to test it out.
Matt Joiner [Mon, 30 Nov 2020 03:26:12 +0000 (14:26 +1100)]
Update required go version
I believe 1.15 is required for testing.T.TempDir.
Matt Joiner [Sat, 21 Nov 2020 02:42:42 +0000 (13:42 +1100)]
piece resource storage: Delete incomplete chunks concurrently after writing complete piece
Matt Joiner [Sat, 21 Nov 2020 02:41:45 +0000 (13:41 +1100)]
Use ConsecutiveChunkWriter in MarkComplete for piece resource storage if available
Matt Joiner [Sat, 21 Nov 2020 02:40:09 +0000 (13:40 +1100)]
Track piece marking state separately
Matt Joiner [Sat, 21 Nov 2020 02:39:04 +0000 (13:39 +1100)]
sqlite storage: Ensure that chunks are consecutive
pataquets [Wed, 18 Nov 2020 14:49:22 +0000 (15:49 +0100)]
Readme: downstream projects info.
Matt Joiner [Mon, 16 Nov 2020 05:25:11 +0000 (16:25 +1100)]
sqlite storage: Remove num batched write queries log message
Matt Joiner [Mon, 16 Nov 2020 01:39:46 +0000 (12:39 +1100)]
Update to race fixes in filecache and sqlite
Matt Joiner [Sat, 14 Nov 2020 11:57:19 +0000 (22:57 +1100)]
sqlite storage: Buffer write requests
Matt Joiner [Sat, 14 Nov 2020 11:56:55 +0000 (22:56 +1100)]
sqlite storage: Add some expvars
Matt Joiner [Sat, 14 Nov 2020 11:56:27 +0000 (22:56 +1100)]
sqlite storage: Add error return from withConn
Matt Joiner [Sat, 14 Nov 2020 11:54:40 +0000 (22:54 +1100)]
Fix panic in when bbolt storage has Closed
Matt Joiner [Sat, 14 Nov 2020 11:53:55 +0000 (22:53 +1100)]
Mark piece complete without Client lock
Matt Joiner [Fri, 13 Nov 2020 04:50:08 +0000 (15:50 +1100)]
Read peer request data without Client lock
Matt Joiner [Thu, 12 Nov 2020 04:25:06 +0000 (15:25 +1100)]
Add support for the x.pe magnet link parameter
Yaroslav Kolomiiets [Thu, 12 Nov 2020 21:24:33 +0000 (21:24 +0000)]
optimise PEX by avoiding intermediate storage while preparing PEX messages
Yaroslav Kolomiiets [Tue, 10 Nov 2020 12:32:40 +0000 (12:32 +0000)]
optimise generation of the initial PEX
Yaroslav Kolomiiets [Mon, 9 Nov 2020 15:05:47 +0000 (15:05 +0000)]
simplify pexMsgFactory
Yaroslav Kolomiiets [Mon, 9 Nov 2020 13:20:23 +0000 (13:20 +0000)]
add test covering a recently fixed regression in initial PEX
Yaroslav Kolomiiets [Wed, 11 Nov 2020 15:10:05 +0000 (15:10 +0000)]
Fix excessive logging from mmap-backed storage (anacrolix/torrent#436)
Matt Joiner [Wed, 11 Nov 2020 04:31:55 +0000 (15:31 +1100)]
Implement fmt.Formatter for metainfo.Hash
It's so easy to make mistakes by specifying %x when printing these.
Matt Joiner [Wed, 11 Nov 2020 04:30:53 +0000 (15:30 +1100)]
Improve cmd/tracker-announce
Add -tracker flag, support specifying infohashes directly, spew announce responses so they're more readable.
Matt Joiner [Sun, 8 Nov 2020 23:56:27 +0000 (10:56 +1100)]
Tidy up doc, file names, naming
Matt Joiner [Sun, 8 Nov 2020 22:20:05 +0000 (09:20 +1100)]
Update README.md
Matt Joiner [Fri, 6 Nov 2020 05:23:23 +0000 (16:23 +1100)]
Fix initial pex message regression
As pointed out by @yarikk https://github.com/anacrolix/torrent/commit/
c1d189ed31af99cbf6f10d9ffdc2cc4e19a73b91 #r43920706
Matt Joiner [Thu, 5 Nov 2020 23:36:49 +0000 (10:36 +1100)]
Replace storage.IncompletePieceToWriter with io.Writer
It was incorrect to assume piece hashing only operates on incomplete chunk data. This actually uncovered a bug where duplicate hash checks occurred, and the redundant checks would fail due to not reading the completed data.
Code7unner [Thu, 5 Nov 2020 07:10:14 +0000 (17:10 +1000)]
Fix PkgGoDev reference in README
Matt Joiner [Thu, 5 Nov 2020 21:39:56 +0000 (08:39 +1100)]
Fix piece getting queued for hash multiple times
Pieces could get queued for hash multiple times when we receive chunks if the piece starts getting hashed before we're done writing all the chunks out. This was only found because piece hashing currently only checks the incomplete data, which is missing after the first piece hash passes, the data is marked complete, then the subsequently queued hash has nothing to read.
Matt Joiner [Thu, 5 Nov 2020 02:28:45 +0000 (13:28 +1100)]
Add the ReceiveEncryptedHandshakeSkeys callback
Matt Joiner [Wed, 4 Nov 2020 05:34:31 +0000 (16:34 +1100)]
mse/cmd/mse: Fail on missing subcommand
Matt Joiner [Wed, 4 Nov 2020 00:34:24 +0000 (11:34 +1100)]
Remove old comment
Matt Joiner [Tue, 3 Nov 2020 04:17:12 +0000 (15:17 +1100)]
sqlite storage: Add capacity management
Matt Joiner [Tue, 3 Nov 2020 04:16:57 +0000 (15:16 +1100)]
sqlite storage: Batch writes synchronously instead of buffering them first
Matt Joiner [Tue, 3 Nov 2020 03:28:16 +0000 (14:28 +1100)]
Comment on storage.IncompletePieceToWriter
Matt Joiner [Tue, 3 Nov 2020 02:11:44 +0000 (13:11 +1100)]
sqlite storage: Init schema in NewPool instead of NewProvider and add an option to disable
Matt Joiner [Tue, 3 Nov 2020 02:10:17 +0000 (13:10 +1100)]
sqlite storage: Track total blob data size manually
Works around possible full table scan at startup, and possible lack of caching around cast(data as blob).
Matt Joiner [Mon, 2 Nov 2020 23:41:47 +0000 (10:41 +1100)]
Update the readahead window on read failure
Matt Joiner [Mon, 2 Nov 2020 04:35:07 +0000 (15:35 +1100)]
Add write incomplete/consecutive chunks interfaces
Matt Joiner [Fri, 30 Oct 2020 08:46:51 +0000 (19:46 +1100)]
sqlite storage: Add batched writes
Matt Joiner [Fri, 30 Oct 2020 07:40:47 +0000 (18:40 +1100)]
sqlite storage: Set mmap_size to a very large size
Seems to fall back to ~2GiB on my system.
Matt Joiner [Fri, 30 Oct 2020 01:20:54 +0000 (12:20 +1100)]
sqlite storage: Provide helpers and reasonable defaults
Matt Joiner [Fri, 30 Oct 2020 01:19:53 +0000 (12:19 +1100)]
Don't delete requests until after they're written to disk
This prevents too many pending writes building up. Webseed peers re-request synchronously, and the writes are done asynchronously, so they download too quickly and there was no backpressure. The backpressure now is provided by the upper limit on outstanding requests per connection.
Matt Joiner [Thu, 29 Oct 2020 23:47:50 +0000 (10:47 +1100)]
sqlite storage: Force data to be used as a blob
There's a bug in crawshaw.io/sqlite, and some forks where inserting []byte results in a text type instead of blob. To ensure things work correctly, we coerce data to blob wherever we can. See https://github.com/crawshaw/sqlite/issues/94 and the fork that fixes it.
Matt Joiner [Thu, 29 Oct 2020 23:42:45 +0000 (10:42 +1100)]
Include a null byte in the middle of the Greeting test
Matt Joiner [Wed, 28 Oct 2020 23:45:38 +0000 (10:45 +1100)]
Fix peer request sleepiness
New requests weren't being issued to the current peer when being deleted. For webseeds, this would cause them to not bother issuing new requests indefinitely.
(cherry picked from commit
146a16df4ea26d33b0ce0391c8220de14c9e18f4 )
Matt Joiner [Wed, 28 Oct 2020 01:09:24 +0000 (12:09 +1100)]
Don't fail on 386 tests in CI
Looks like crawshaw.io/sqlite fails to build, possibly due to cross-compiling.
Matt Joiner [Tue, 27 Oct 2020 23:03:37 +0000 (10:03 +1100)]
Switch CI to go1.15
Matt Joiner [Tue, 27 Oct 2020 06:56:55 +0000 (17:56 +1100)]
Remove some unused code
Matt Joiner [Tue, 27 Oct 2020 06:07:49 +0000 (17:07 +1100)]
Performance fiddling on sqlite storage
Matt Joiner [Tue, 27 Oct 2020 03:10:17 +0000 (14:10 +1100)]
Return errors from Reader if data downloading won't occur
Chunk write errors to storage can disable data download. Previously Readers would wait indefinitely for the data to become available. This change returns an error instead of stalling.
Matt Joiner [Tue, 27 Oct 2020 01:59:07 +0000 (12:59 +1100)]
Don't block trying to fill entire Reader.Read
This conforms more to the contract in io.Reader. It's possible the old behaviour was better in reducing overhead, but that can be iterated on (or added as comments next time).
Matt Joiner [Tue, 27 Oct 2020 01:24:43 +0000 (12:24 +1100)]
Read from more than a single piece in each read to Torrent storage
Matt Joiner [Tue, 27 Oct 2020 01:05:40 +0000 (12:05 +1100)]
Remove separate readable/available in Reader
Matt Joiner [Tue, 27 Oct 2020 00:08:37 +0000 (11:08 +1100)]
sqlite storage: Include capacity management
Matt Joiner [Tue, 27 Oct 2020 00:08:08 +0000 (11:08 +1100)]
sqlite storage: Do ReadAt without using incremental I/O
Matt Joiner [Fri, 23 Oct 2020 00:03:42 +0000 (11:03 +1100)]
sqlite storage: Working recursive CTE for excess data
Matt Joiner [Thu, 22 Oct 2020 22:03:44 +0000 (09:03 +1100)]
sqlite storage: Add NewProviderPool
Matt Joiner [Thu, 22 Oct 2020 22:01:15 +0000 (09:01 +1100)]
sqlite storage: Rename table to blob
Avoiding plural table names.
Matt Joiner [Thu, 22 Oct 2020 21:58:55 +0000 (08:58 +1100)]
Performance improvements to PEX
Matt Joiner [Thu, 15 Oct 2020 05:03:43 +0000 (16:03 +1100)]
Fix error handling for bad torrent adds with safe file handling
Matt Joiner [Thu, 15 Oct 2020 04:45:08 +0000 (15:45 +1100)]
Sanitize metainfo file paths for file-based storage
Fixes exploit where specially crafted infos can cause the client to write files to arbitrary locations on local storage when using file-based storages like mmap and file.
Matt Joiner [Thu, 15 Oct 2020 01:56:06 +0000 (12:56 +1100)]
Don't update requests for the current connection first when a request is deleted
Matt Joiner [Thu, 15 Oct 2020 01:45:19 +0000 (12:45 +1100)]
We might want to close webseed peers on response errors
Matt Joiner [Thu, 15 Oct 2020 01:42:27 +0000 (12:42 +1100)]
webseed: Handle http response status codes
Matt Joiner [Wed, 14 Oct 2020 04:11:45 +0000 (15:11 +1100)]
Ensure PeerConn._close is called for incoming connections
This fixes missing calls to PeerConnClosed callback.
Matt Joiner [Tue, 13 Oct 2020 02:34:05 +0000 (13:34 +1100)]
Test both sqlite file and in-memory leecher storages
Matt Joiner [Tue, 13 Oct 2020 02:33:22 +0000 (13:33 +1100)]
Move pexConnState from peer to PeerConn
Matt Joiner [Tue, 13 Oct 2020 02:02:39 +0000 (13:02 +1100)]
Add PeerConnClosed callback
Matt Joiner [Mon, 12 Oct 2020 22:36:58 +0000 (09:36 +1100)]
Add last_used to sqlite storage
Matt Joiner [Mon, 12 Oct 2020 06:13:05 +0000 (17:13 +1100)]
Use bind-blob fix for crawshaw.io/sqlite
Matt Joiner [Mon, 12 Oct 2020 06:12:34 +0000 (17:12 +1100)]
Fix some log levels
Matt Joiner [Sun, 11 Oct 2020 01:58:27 +0000 (12:58 +1100)]
Add a sqlite data storage implementation
Matt Joiner [Sun, 11 Oct 2020 01:57:33 +0000 (12:57 +1100)]
Panic on bad piece per resource chunk names
This was masking a bug in a coming sqlite storage implementation. Maybe it could be relaxed to checking for no filepath.Dir in the future.
Matt Joiner [Sun, 11 Oct 2020 01:54:03 +0000 (12:54 +1100)]
Tweaks to storage error and completion handling
Matt Joiner [Sun, 11 Oct 2020 01:40:43 +0000 (12:40 +1100)]
Tidy up some storage close handling
Matt Joiner [Fri, 9 Oct 2020 23:59:17 +0000 (10:59 +1100)]
Use testing.T.Name instead of missinggo.GetTestName
This handles subtests correctly, and removes the need to specify when to export due to collisions with the old function.
Matt Joiner [Fri, 9 Oct 2020 23:24:58 +0000 (10:24 +1100)]
Tidy up some logging
Matt Joiner [Tue, 6 Oct 2020 23:22:55 +0000 (10:22 +1100)]
Fix webseed requests for non-trivial path components
Matt Joiner [Mon, 5 Oct 2020 22:50:47 +0000 (09:50 +1100)]
Fix PeerConn conn status string
Matt Joiner [Thu, 1 Oct 2020 01:50:42 +0000 (11:50 +1000)]
Fix unused import
Matt Joiner [Thu, 1 Oct 2020 01:45:47 +0000 (11:45 +1000)]
Set tracker announce timeout back to default
Add lots of comments about how this works and why.
Matt Joiner [Thu, 1 Oct 2020 01:20:44 +0000 (11:20 +1000)]
Expose Client.ConnStats
Matt Joiner [Thu, 1 Oct 2020 00:46:27 +0000 (10:46 +1000)]
Include ip param in http announces
Matt Joiner [Thu, 1 Oct 2020 00:45:29 +0000 (10:45 +1000)]
Pass key param in http announces
Matt Joiner [Thu, 1 Oct 2020 00:45:05 +0000 (10:45 +1000)]
Rework HTTP announce timeouts
Use Request.Context to implement timeouts, set the default to 3s for announces from the Client.
Matt Joiner [Thu, 1 Oct 2020 00:43:10 +0000 (10:43 +1000)]
Limit simultaneous announces to the same URL
Matt Joiner [Wed, 30 Sep 2020 06:56:27 +0000 (16:56 +1000)]
Limit half-open connections at the Client level
Matt Joiner [Tue, 29 Sep 2020 06:42:52 +0000 (16:42 +1000)]
Rename struct size test
Matt Joiner [Tue, 29 Sep 2020 06:37:58 +0000 (16:37 +1000)]
Optimize padding on Piece
Matt Joiner [Tue, 29 Sep 2020 06:24:43 +0000 (16:24 +1000)]
Add a test for Piece size
Matt Joiner [Tue, 29 Sep 2020 06:21:54 +0000 (16:21 +1000)]
Fix conn status string for WebRTC connections
Matt Joiner [Thu, 3 Sep 2020 04:34:06 +0000 (14:34 +1000)]
Fix panic for unexpected piece rejections
Should fix #419.
Matt Joiner [Tue, 11 Aug 2020 01:43:12 +0000 (11:43 +1000)]
Add to downstream projects in README
CortexFoundation/torrentfs
Matt Joiner [Wed, 15 Jul 2020 06:16:09 +0000 (16:16 +1000)]
Add ReadExtendedHandshake callback
Matt Joiner [Wed, 15 Jul 2020 06:15:38 +0000 (16:15 +1000)]
Expose peer.RemoteAddr
Matt Joiner [Wed, 15 Jul 2020 06:13:26 +0000 (16:13 +1000)]
Switch to crawshaw.io/sqlite
I'm using it elsewhere, and it seems to conflict when linking with github.com/mattn/go-sqlite3.