]> Sergey Matveev's repositories - btrtrc.git/log
btrtrc.git
7 years agoPanic if NewHashFromHex gets a bad string
Matt Joiner [Sat, 31 Dec 2016 23:07:05 +0000 (10:07 +1100)]
Panic if NewHashFromHex gets a bad string

7 years agoRewrite cmd/torrent-verify
Matt Joiner [Sat, 31 Dec 2016 23:05:41 +0000 (10:05 +1100)]
Rewrite cmd/torrent-verify

Fixes #141

7 years agoUpdate README.md
Matt Joiner [Sat, 31 Dec 2016 08:17:00 +0000 (19:17 +1100)]
Update README.md

Add Trickl android app

7 years agoUpdate README.md
Matt Joiner [Sat, 31 Dec 2016 08:07:02 +0000 (19:07 +1100)]
Update README.md

Closes #143

7 years agodht/… moved to github.com/anacrolix/dht
Matt Joiner [Wed, 14 Dec 2016 00:43:37 +0000 (11:43 +1100)]
dht/… moved to github.com/anacrolix/dht

7 years agoRename dht/krpc.KRPCError -> Error
Matt Joiner [Tue, 13 Dec 2016 03:50:42 +0000 (14:50 +1100)]
Rename dht/krpc.KRPCError -> Error

7 years agodht: Reply with Method Unknown error to unknown query methods received
Matt Joiner [Tue, 13 Dec 2016 03:45:40 +0000 (14:45 +1100)]
dht: Reply with Method Unknown error to unknown query methods received

7 years agoFix race condition in TestPieceHashFailed
Matt Joiner [Tue, 13 Dec 2016 03:44:00 +0000 (14:44 +1100)]
Fix race condition in TestPieceHashFailed

7 years agoAdded optional source flag to torrent files (#137)
Barsanuphe [Fri, 9 Dec 2016 02:16:56 +0000 (03:16 +0100)]
Added optional source flag to torrent files (#137)

7 years agoFix piece failures not clearing dirty chunks
Matt Joiner [Tue, 6 Dec 2016 05:10:10 +0000 (16:10 +1100)]
Fix piece failures not clearing dirty chunks

I don’t like how complicated piece completion/hashing management is, but it works.

7 years agoMerge commit 'c8dffdb'
Matt Joiner [Tue, 6 Dec 2016 04:43:00 +0000 (15:43 +1100)]
Merge commit 'c8dffdb'

7 years agoAdd test that dirty chunks are cleared on piece hash failure
Matt Joiner [Tue, 6 Dec 2016 04:41:08 +0000 (15:41 +1100)]
Add test that dirty chunks are cleared on piece hash failure

7 years agoReader.Close: Don’t set t to nil, we may still expect it
Matt Joiner [Mon, 5 Dec 2016 11:00:26 +0000 (22:00 +1100)]
Reader.Close: Don’t set t to nil, we may still expect it

For example in goroutines spawned in ReadContext.

7 years agoiplist: Begin adding support for parsing CIDR lists
Matt Joiner [Thu, 1 Dec 2016 04:41:52 +0000 (15:41 +1100)]
iplist: Begin adding support for parsing CIDR lists

7 years agoAdd Torrent.Closed
Matt Joiner [Wed, 30 Nov 2016 07:02:39 +0000 (18:02 +1100)]
Add Torrent.Closed

7 years agocmd/torrent: Accept infohash: scheme torrents
Matt Joiner [Wed, 30 Nov 2016 07:02:21 +0000 (18:02 +1100)]
cmd/torrent: Accept infohash: scheme torrents

7 years agoFix logging of trust slice
Matt Joiner [Wed, 30 Nov 2016 07:01:39 +0000 (18:01 +1100)]
Fix logging of trust slice

7 years agoAvoid deadlock caused by receiving PORT and and DHT announce_peer at the same time
Matt Joiner [Sun, 27 Nov 2016 13:03:10 +0000 (00:03 +1100)]
Avoid deadlock caused by receiving PORT and and DHT announce_peer at the same time

7 years agoFix deadlock in Client.onDHTAnnouncePeer
Matt Joiner [Sun, 27 Nov 2016 03:43:21 +0000 (14:43 +1100)]
Fix deadlock in Client.onDHTAnnouncePeer

7 years agoFix harmless race conditions in Client.WriteStatus introduced way back
Matt Joiner [Sun, 27 Nov 2016 03:26:45 +0000 (14:26 +1100)]
Fix harmless race conditions in Client.WriteStatus introduced way back

7 years agodht.NewServer: Initialize the tokenServer
Matt Joiner [Sat, 26 Nov 2016 15:22:47 +0000 (02:22 +1100)]
dht.NewServer: Initialize the tokenServer

7 years agoAdd peers received from received announce_peer DHT messages to the Client
Matt Joiner [Sat, 26 Nov 2016 13:05:19 +0000 (00:05 +1100)]
Add peers received from received announce_peer DHT messages to the Client

Addresses #133

7 years agodht.Server: Return valid token from get_peers, and handle incoming announce_peer
Matt Joiner [Sat, 26 Nov 2016 05:14:37 +0000 (16:14 +1100)]
dht.Server: Return valid token from get_peers, and handle incoming announce_peer

Addresses #133.

7 years agoRemove unused function
Matt Joiner [Fri, 25 Nov 2016 06:24:29 +0000 (17:24 +1100)]
Remove unused function

7 years agoRemove completed TODO item
Matt Joiner [Fri, 25 Nov 2016 06:24:16 +0000 (17:24 +1100)]
Remove completed TODO item

7 years agoKick only the worst connection when a piece fails a check
Matt Joiner [Wed, 23 Nov 2016 01:59:23 +0000 (12:59 +1100)]
Kick only the worst connection when a piece fails a check

7 years agoAdd a note about dropping connections that we sent a HAVE for incomplete pieces
Matt Joiner [Wed, 23 Nov 2016 00:52:41 +0000 (11:52 +1100)]
Add a note about dropping connections that we sent a HAVE for incomplete pieces

7 years agoMake Torrent.conns a map
Matt Joiner [Wed, 23 Nov 2016 00:48:44 +0000 (11:48 +1100)]
Make Torrent.conns a map

Can't remember if I've tried this before. But dropping arbitrary connections while iterating established conns will become much simpler.

7 years agoMove a bunch of Client methods onto more appropriate types
Matt Joiner [Tue, 22 Nov 2016 10:12:53 +0000 (21:12 +1100)]
Move a bunch of Client methods onto more appropriate types

7 years agotracker: Support the original http response peers format
Matt Joiner [Tue, 22 Nov 2016 04:40:46 +0000 (15:40 +1100)]
tracker: Support the original http response peers format

Fixes #130

7 years agoDon't accept pieces with bad indexes
Matt Joiner [Tue, 22 Nov 2016 03:20:48 +0000 (14:20 +1100)]
Don't accept pieces with bad indexes

Fixes #132

7 years agoRename connection.downloadedChunk -> receiveChunk
Matt Joiner [Tue, 22 Nov 2016 03:18:09 +0000 (14:18 +1100)]
Rename connection.downloadedChunk -> receiveChunk

7 years agoMake downloadedChunk a method of connection
Matt Joiner [Tue, 22 Nov 2016 03:17:30 +0000 (14:17 +1100)]
Make downloadedChunk a method of connection

7 years agoMove Client.downloadedChunk to connection.go
Matt Joiner [Tue, 22 Nov 2016 03:16:18 +0000 (14:16 +1100)]
Move Client.downloadedChunk to connection.go

7 years agoTODO
Matt Joiner [Tue, 22 Nov 2016 03:01:17 +0000 (14:01 +1100)]
TODO

7 years agogofmt simplify
Matt Joiner [Tue, 22 Nov 2016 03:01:09 +0000 (14:01 +1100)]
gofmt simplify

7 years agometainfo: Remove unused import
Matt Joiner [Tue, 8 Nov 2016 10:09:04 +0000 (21:09 +1100)]
metainfo: Remove unused import

7 years agofeat: remove print BuildFromFilePath
Vincent [Fri, 4 Nov 2016 22:32:51 +0000 (15:32 -0700)]
feat: remove print BuildFromFilePath

removes the print of (path, err) in function BuildFromFilePath

7 years agoReader.Close: Prefer to lock Client in public method
Matt Joiner [Mon, 31 Oct 2016 08:05:33 +0000 (19:05 +1100)]
Reader.Close: Prefer to lock Client in public method

7 years agoTorrent.unpendPieces: Only update unpended pieces
Matt Joiner [Mon, 31 Oct 2016 08:05:08 +0000 (19:05 +1100)]
Torrent.unpendPieces: Only update unpended pieces

Updating all pieces at once is no longer faster. (There was an optimization for this a while ago that no longer exists.)

7 years agoWhen Reader position changes only update piece priorities that may be affected
Matt Joiner [Mon, 31 Oct 2016 08:00:08 +0000 (19:00 +1100)]
When Reader position changes only update piece priorities that may be affected

Seems to significantly reduce CPU load reading from torrents with huge piece counts.

7 years agoDitch the use of generic slices.HeapInterface for finding the worst "bad" connection
Matt Joiner [Mon, 31 Oct 2016 05:24:48 +0000 (16:24 +1100)]
Ditch the use of generic slices.HeapInterface for finding the worst "bad" connection

It's become a bottleneck. Implement it directly using heap.Interface.

7 years agoComment on connection.updatePiecePriority
Matt Joiner [Mon, 31 Oct 2016 05:22:07 +0000 (16:22 +1100)]
Comment on connection.updatePiecePriority

There's also Torrent.updatePiecePriority, and it's always confusing what the difference is.

7 years agostorage: ClientImpl interface now includes Close
Matt Joiner [Tue, 25 Oct 2016 09:00:09 +0000 (20:00 +1100)]
storage: ClientImpl interface now includes Close

This is now necessary because bolt doesn't allow multiple DB handles, so the bolt piece completion DB instance must be at the client level. The new method is not currently used from the Client however, this maybe necessary to avoid leaks.

7 years agostorage: Fix spelling mistake
Matt Joiner [Tue, 25 Oct 2016 08:57:35 +0000 (19:57 +1100)]
storage: Fix spelling mistake

7 years agostorage: Only include sqlite3 piece completion implementation if cgo is enabled
Matt Joiner [Tue, 25 Oct 2016 08:54:09 +0000 (19:54 +1100)]
storage: Only include sqlite3 piece completion implementation if cgo is enabled

Issue #124.

7 years agostorage: Remove sqlite3 import from bolt implementation
Matt Joiner [Tue, 25 Oct 2016 08:52:44 +0000 (19:52 +1100)]
storage: Remove sqlite3 import from bolt implementation

#124

7 years agoTrivial HTTP support for adding torrent files by (#126)
Igor Shishkin [Tue, 25 Oct 2016 08:13:06 +0000 (11:13 +0300)]
Trivial HTTP support for adding torrent files by (#126)

* Trivial HTTP support for adding torrent files by

Sometimes it's really usefull to do not download
torrent file locally but simply pass HTTP link
this patch adds such ability.

Signed-off-by: Igor Shishkin <me@teran.ru>
* Fix for closing http connection after use

Signed-off-by: Igor Shishkin <me@teran.ru>
7 years agoAdd bolt piece completion DB
Matt Joiner [Tue, 25 Oct 2016 08:07:26 +0000 (19:07 +1100)]
Add bolt piece completion DB

This means it can be persistent without needing cgo. Fixes issues #115 and #124.

7 years agoMove the implementation of connection.requestPiecePendingChunks out of Torrent
Matt Joiner [Tue, 25 Oct 2016 03:58:17 +0000 (14:58 +1100)]
Move the implementation of connection.requestPiecePendingChunks out of Torrent

7 years agoReader.SetReadahead can change readahead pieces
Matt Joiner [Mon, 24 Oct 2016 08:35:12 +0000 (19:35 +1100)]
Reader.SetReadahead can change readahead pieces

7 years agoOptimize piece priorities when reader position changes
Matt Joiner [Sun, 23 Oct 2016 05:33:26 +0000 (16:33 +1100)]
Optimize piece priorities when reader position changes

Gives a decent boost to throughput and reduces a lot of CPU when reading very quickly from Reader.

7 years agoAdd TODO item
Matt Joiner [Tue, 18 Oct 2016 14:38:54 +0000 (01:38 +1100)]
Add TODO item

7 years agoFix not working import
Thomas Maurice [Fri, 14 Oct 2016 18:07:44 +0000 (20:07 +0200)]
Fix not working import

7 years agoAdd download rate limiting
Matt Joiner [Mon, 10 Oct 2016 06:29:39 +0000 (17:29 +1100)]
Add download rate limiting

Fixes #121.

7 years agoMake newConnection a method on Client
Matt Joiner [Mon, 10 Oct 2016 05:55:56 +0000 (16:55 +1100)]
Make newConnection a method on Client

7 years agoSplit connection.rw into separate Reader and Writer
Matt Joiner [Mon, 10 Oct 2016 05:30:51 +0000 (16:30 +1100)]
Split connection.rw into separate Reader and Writer

This will make it easier to write hooks for Read and Write separately.

7 years agoFix Config.UploadRateLimiter comment
Matt Joiner [Mon, 10 Oct 2016 04:03:02 +0000 (15:03 +1100)]
Fix Config.UploadRateLimiter comment

7 years agoAdd really simple upload rate limiting and test
Matt Joiner [Mon, 10 Oct 2016 03:58:29 +0000 (14:58 +1100)]
Add really simple upload rate limiting and test

7 years agoImprove code comments
Matt Joiner [Mon, 10 Oct 2016 03:57:34 +0000 (14:57 +1100)]
Improve code comments

7 years agoReorder the fields of struct Client
Matt Joiner [Sun, 9 Oct 2016 13:04:14 +0000 (00:04 +1100)]
Reorder the fields of struct Client

7 years agoUpdate README.md
Matt Joiner [Thu, 6 Oct 2016 03:58:50 +0000 (14:58 +1100)]
Update README.md

The build status badge is not helpful due to the aggressive testing and badge caching.

7 years agoDefault to debug mode in client testing config
Matt Joiner [Wed, 5 Oct 2016 04:57:38 +0000 (15:57 +1100)]
Default to debug mode in client testing config

7 years agoDo chunk pooling at Torrent instead of connection level
Matt Joiner [Wed, 5 Oct 2016 04:57:00 +0000 (15:57 +1100)]
Do chunk pooling at Torrent instead of connection level

7 years agoSpeed up mse.handshake.establishS
Matt Joiner [Fri, 30 Sep 2016 02:14:34 +0000 (12:14 +1000)]
Speed up mse.handshake.establishS

Remove possible slice allocation, and avoid reflect.

7 years agopeer_protocol.Decoder.Decode: Avoid allocating another intermediate reader
Matt Joiner [Sun, 25 Sep 2016 00:31:43 +0000 (10:31 +1000)]
peer_protocol.Decoder.Decode: Avoid allocating another intermediate reader

On my system, BenchmarkConnectionMainReadLoop goes from 596 to 1311 MB/s.

7 years agofix unreadable id when started
Meng Zhuo [Wed, 21 Sep 2016 11:53:05 +0000 (19:53 +0800)]
fix unreadable id when started

7 years agofix dht-server cmd won't exit after Ctrl+C
Meng Zhuo [Wed, 21 Sep 2016 11:36:07 +0000 (19:36 +0800)]
fix dht-server cmd won't exit after Ctrl+C

7 years agoCreate missing intermediate directories in test
Matt Joiner [Wed, 21 Sep 2016 11:17:22 +0000 (21:17 +1000)]
Create missing intermediate directories in test

7 years agoFix Client.receiveSkeys
Matt Joiner [Wed, 21 Sep 2016 11:04:52 +0000 (21:04 +1000)]
Fix Client.receiveSkeys

Fixes #114. Loop variables in Go are ****ed.

7 years agoTidy up TestMultipleTorrentsWithEncryption test
Matt Joiner [Wed, 21 Sep 2016 11:02:18 +0000 (21:02 +1000)]
Tidy up TestMultipleTorrentsWithEncryption test

7 years agoAdd some more debug logging
Matt Joiner [Wed, 21 Sep 2016 11:00:18 +0000 (21:00 +1000)]
Add some more debug logging

7 years agoFormatting fixes
Matt Joiner [Tue, 20 Sep 2016 08:39:36 +0000 (18:39 +1000)]
Formatting fixes

7 years agoFixes for changes to metainfo.MetaInfo.UnmarshalInfo
Matt Joiner [Tue, 20 Sep 2016 08:39:07 +0000 (18:39 +1000)]
Fixes for changes to metainfo.MetaInfo.UnmarshalInfo

7 years agoAdd error return value to metainfo.MetaInfo.UnmarshalInfo
Matt Joiner [Tue, 20 Sep 2016 02:25:40 +0000 (12:25 +1000)]
Add error return value to metainfo.MetaInfo.UnmarshalInfo

Too many problems caused by bad info bytes in downstream projects.

7 years agoAdd a test case for #114 (#117)
Michael Howell [Fri, 16 Sep 2016 14:01:15 +0000 (07:01 -0700)]
Add a test case for #114 (#117)

7 years agoAdd Config.{Force,PreferNo}Encryption
Matt Joiner [Fri, 16 Sep 2016 02:42:41 +0000 (12:42 +1000)]
Add Config.{Force,PreferNo}Encryption

7 years agoMinor comments and test improvement
Matt Joiner [Fri, 16 Sep 2016 02:13:06 +0000 (12:13 +1000)]
Minor comments and test improvement

7 years agostorage: Move sqlite3 import to appropriate file
Matt Joiner [Fri, 16 Sep 2016 01:19:26 +0000 (11:19 +1000)]
storage: Move sqlite3 import to appropriate file

7 years agoComment on metainfo.PieceKey
Matt Joiner [Fri, 16 Sep 2016 01:18:36 +0000 (11:18 +1000)]
Comment on metainfo.PieceKey

7 years agoAdd note in README about the mobile branch
Matt Joiner [Tue, 13 Sep 2016 04:03:55 +0000 (14:03 +1000)]
Add note in README about the mobile branch

7 years agocmd/torrent: Fix progress bar for zero-length torrents
Matt Joiner [Mon, 12 Sep 2016 07:47:07 +0000 (17:47 +1000)]
cmd/torrent: Fix progress bar for zero-length torrents

7 years agoUse sync.pool for decode buffer
Ye Yin [Mon, 12 Sep 2016 07:10:11 +0000 (15:10 +0800)]
Use sync.pool for decode buffer

7 years agoRename some of the unexported file storage types
Matt Joiner [Mon, 12 Sep 2016 07:26:39 +0000 (17:26 +1000)]
Rename some of the unexported file storage types

7 years agoTest empty files and zero piece length for both file and mmap storage backends
Matt Joiner [Mon, 12 Sep 2016 07:11:32 +0000 (17:11 +1000)]
Test empty files and zero piece length for both file and mmap storage backends

7 years agoCreate zero-length files in the file storage when the torrent storage is opened
Matt Joiner [Mon, 12 Sep 2016 07:01:00 +0000 (17:01 +1000)]
Create zero-length files in the file storage when the torrent storage is opened

Fixes #111.

7 years agoFix issue #112
Matt Joiner [Mon, 12 Sep 2016 06:54:43 +0000 (16:54 +1000)]
Fix issue #112

7 years agoAdd test for issue #111 and #112
Matt Joiner [Mon, 12 Sep 2016 06:53:20 +0000 (16:53 +1000)]
Add test for issue #111 and #112

7 years agoAdd a benchmark for readMainLoop piece decoding
Matt Joiner [Sun, 11 Sep 2016 05:43:57 +0000 (15:43 +1000)]
Add a benchmark for readMainLoop piece decoding

7 years agoMove Client.connectionLoop to connection.mainReadLoop
Matt Joiner [Sun, 11 Sep 2016 04:32:56 +0000 (14:32 +1000)]
Move Client.connectionLoop to connection.mainReadLoop

7 years agoRemove unused trackerTier and shuffleTier
Matt Joiner [Sun, 11 Sep 2016 04:12:03 +0000 (14:12 +1000)]
Remove unused trackerTier and shuffleTier

7 years agoMove TorrentSpec stuff into its own file
Matt Joiner [Sun, 11 Sep 2016 04:09:40 +0000 (14:09 +1000)]
Move TorrentSpec stuff into its own file

7 years agoComment typo (#110)
Ben Gadbois [Tue, 6 Sep 2016 23:43:29 +0000 (16:43 -0700)]
Comment typo (#110)

7 years agoRelax the seeder torrent connection stats test
Matt Joiner [Fri, 2 Sep 2016 05:26:21 +0000 (15:26 +1000)]
Relax the seeder torrent connection stats test

The values have changed due to the recent storage change, I'm not sure why, and I don't know if it's important.

7 years agoRework storage interfaces to make them simpler to implement
Matt Joiner [Fri, 2 Sep 2016 05:10:57 +0000 (15:10 +1000)]
Rework storage interfaces to make them simpler to implement

This allows lots of behaviour to be baked into the new Client, Torrent and Piece wrappers, rather than duplicating (badly) them in all the backend implementations.

7 years agostorage.boltDB: Some comments, and use global completedValue
Matt Joiner [Wed, 31 Aug 2016 11:00:44 +0000 (21:00 +1000)]
storage.boltDB: Some comments, and use global completedValue

7 years agoImprove test reliability on Linux and reduce log noise in tests
Matt Joiner [Wed, 31 Aug 2016 10:14:57 +0000 (20:14 +1000)]
Improve test reliability on Linux and reduce log noise in tests

7 years agoExtract chunkSize as a const
Matt Joiner [Wed, 31 Aug 2016 08:04:11 +0000 (18:04 +1000)]
Extract chunkSize as a const

7 years agoPass seed option to Config for cmd/torrent (#108)
Matt Joiner [Wed, 31 Aug 2016 09:33:54 +0000 (19:33 +1000)]
Pass seed option to Config for cmd/torrent (#108)

7 years agoPass seed option to Config for cmd/torrent
Ye Yin [Wed, 31 Aug 2016 09:20:20 +0000 (17:20 +0800)]
Pass seed option to Config for cmd/torrent