]> Sergey Matveev's repositories - btrtrc.git/log
btrtrc.git
8 years agoRemove sync.Cond from piece
Matt Joiner [Thu, 5 Nov 2015 13:40:16 +0000 (00:40 +1100)]
Remove sync.Cond from piece

It's not trivial to ensure that anyone waiting on the piece Cond will wake on events like the torrent being dropped from the client.

8 years agoDitch go-flags for tagflag
Matt Joiner [Thu, 5 Nov 2015 12:21:39 +0000 (23:21 +1100)]
Ditch go-flags for tagflag

Fixes #37

8 years agobencode: Improve unknown value type error
Matt Joiner [Tue, 3 Nov 2015 12:21:10 +0000 (23:21 +1100)]
bencode: Improve unknown value type error

8 years agohttpfile.Open can now return an error
Matt Joiner [Fri, 30 Oct 2015 11:21:48 +0000 (22:21 +1100)]
httpfile.Open can now return an error

8 years agometainfo: Add alternative "builder" API
Matt Joiner [Thu, 29 Oct 2015 14:21:09 +0000 (01:21 +1100)]
metainfo: Add alternative "builder" API

The existing builder API is gross and heavy-handed. I won't rip it out just yet.

8 years agodht: Handle bad responses to get_peers
Matt Joiner [Thu, 29 Oct 2015 14:18:29 +0000 (01:18 +1100)]
dht: Handle bad responses to get_peers

8 years agoAvoid copying mutex in piece
Matt Joiner [Thu, 29 Oct 2015 14:16:52 +0000 (01:16 +1100)]
Avoid copying mutex in piece

8 years agoFix #35
Matt Joiner [Thu, 29 Oct 2015 12:47:13 +0000 (23:47 +1100)]
Fix #35

8 years agoAdd test for issue 35
Matt Joiner [Thu, 29 Oct 2015 12:46:47 +0000 (23:46 +1100)]
Add test for issue 35

8 years agoSome missing io.EOFs
Matt Joiner [Fri, 23 Oct 2015 01:45:51 +0000 (12:45 +1100)]
Some missing io.EOFs

8 years agodata/pieceStore: Expose flags in Open method
Matt Joiner [Fri, 23 Oct 2015 01:45:11 +0000 (12:45 +1100)]
data/pieceStore: Expose flags in Open method

8 years agoTidy
Matt Joiner [Fri, 23 Oct 2015 01:42:57 +0000 (12:42 +1100)]
Tidy

8 years agocmd/torrent: Expose --mmap
Matt Joiner [Fri, 23 Oct 2015 01:42:19 +0000 (12:42 +1100)]
cmd/torrent: Expose --mmap

8 years agodht: Make Msg a struct with bencode tags
Matt Joiner [Fri, 23 Oct 2015 01:41:45 +0000 (12:41 +1100)]
dht: Make Msg a struct with bencode tags

8 years agoMerge branch 'master' of github.com:anacrolix/torrent
Matt Joiner [Fri, 23 Oct 2015 01:38:00 +0000 (12:38 +1100)]
Merge branch 'master' of github.com:anacrolix/torrent

8 years agobencode: Can't get zero type of a nil interface
Matt Joiner [Fri, 23 Oct 2015 01:37:30 +0000 (12:37 +1100)]
bencode: Can't get zero type of a nil interface

8 years agobencode: Rethrow non-errors during encoding
Matt Joiner [Fri, 23 Oct 2015 01:36:47 +0000 (12:36 +1100)]
bencode: Rethrow non-errors during encoding

8 years agobencode: Encoding nil interfaces are an error except at data root
Matt Joiner [Fri, 23 Oct 2015 01:35:38 +0000 (12:35 +1100)]
bencode: Encoding nil interfaces are an error except at data root

8 years agoFix #33.
Matt Joiner [Tue, 20 Oct 2015 06:53:12 +0000 (17:53 +1100)]
Fix #33.

8 years agoMake Piece a concrete type
Matt Joiner [Sun, 18 Oct 2015 14:31:34 +0000 (01:31 +1100)]
Make Piece a concrete type

There was a lot of allocations occuring because it was an interface.

8 years agobencode: Don't skip encoding nil pointers and interfaces
Matt Joiner [Sun, 18 Oct 2015 14:28:36 +0000 (01:28 +1100)]
bencode: Don't skip encoding nil pointers and interfaces

This caused an annoying bug for complex types where dictionary values went missing.

8 years agobencode: Use default field name if it isn't given (but options are)
Matt Joiner [Sun, 18 Oct 2015 14:27:15 +0000 (01:27 +1100)]
bencode: Use default field name if it isn't given (but options are)

8 years agobencode: Tidy up
Matt Joiner [Sun, 18 Oct 2015 14:25:56 +0000 (01:25 +1100)]
bencode: Tidy up

8 years agoMissed in last commit
Matt Joiner [Sun, 18 Oct 2015 13:02:42 +0000 (00:02 +1100)]
Missed in last commit

8 years agoAvoid allocation in iplist.Ranger.Lookup
Matt Joiner [Sun, 18 Oct 2015 13:00:26 +0000 (00:00 +1100)]
Avoid allocation in iplist.Ranger.Lookup

It was very expensive for DHT packets.

8 years agoUpdate TODO
Matt Joiner [Sat, 17 Oct 2015 15:32:24 +0000 (02:32 +1100)]
Update TODO

8 years agoStore pieces inplace in torrent.Pieces
Matt Joiner [Fri, 16 Oct 2015 11:10:03 +0000 (22:10 +1100)]
Store pieces inplace in torrent.Pieces

This should save some allocation overhead, especially for torrents that have 20k+ pieces.

8 years agoUpdate README
Matt Joiner [Fri, 16 Oct 2015 11:07:13 +0000 (22:07 +1100)]
Update README

8 years agoMerge pull request #31 from kupsef/master
Matt Joiner [Sat, 10 Oct 2015 22:46:47 +0000 (09:46 +1100)]
Merge pull request #31 from kupsef/master

fix: added announce to torrent spec

8 years agofix: added announce to torrent spec
Kupai József [Sat, 10 Oct 2015 12:31:02 +0000 (14:31 +0200)]
fix: added announce to torrent spec

8 years agoSome slow tracker tests can be Parallel
Matt Joiner [Sun, 4 Oct 2015 08:58:23 +0000 (19:58 +1100)]
Some slow tracker tests can be Parallel

8 years agoCreate a pieceStore interface, and merge in my httpfile backend, and replace data...
Matt Joiner [Sat, 3 Oct 2015 14:22:46 +0000 (00:22 +1000)]
Create a pieceStore interface, and merge in my httpfile backend, and replace data/blob

data/blob was aging, and had severe performance problems. It's now possible to use missinggo/filecache as a data backend to pieceStore which is better tested and performs excellently.

8 years agoutp package merged PacketConn with Socket
Matt Joiner [Sat, 3 Oct 2015 14:02:14 +0000 (00:02 +1000)]
utp package merged PacketConn with Socket

8 years agofs test: Missed package specifier
Matt Joiner [Thu, 1 Oct 2015 14:16:50 +0000 (00:16 +1000)]
fs test: Missed package specifier

8 years agoFix import cycle
Matt Joiner [Thu, 1 Oct 2015 14:16:25 +0000 (00:16 +1000)]
Fix import cycle

8 years agobencode: When decoding a dict, if the final key is missing its value, don't treat...
Matt Joiner [Thu, 1 Oct 2015 14:13:43 +0000 (00:13 +1000)]
bencode: When decoding a dict, if the final key is missing its value, don't treat that as an error.

I think I'm swayed here by the robustness principle/Postel's Law.

8 years agoSimplify the torrent Data interface
Matt Joiner [Thu, 1 Oct 2015 14:09:04 +0000 (00:09 +1000)]
Simplify the torrent Data interface

None of the methods are optional anymore. Removed the nasty wrappers for some data implementations. Moved data.Data back into the main torrent package. Should make it much easier to understand for people implementing their own Data implementations.

8 years agoMatch the names used in other blob implementations
Matt Joiner [Thu, 1 Oct 2015 05:41:30 +0000 (15:41 +1000)]
Match the names used in other blob implementations

8 years agoReduce UDP tracker response buffer size from 64KiB to 2KiB
Matt Joiner [Wed, 30 Sep 2015 14:36:41 +0000 (00:36 +1000)]
Reduce UDP tracker response buffer size from 64KiB to 2KiB

8 years agoTrack peer sources with a dict, and don't exceed high water mark
Matt Joiner [Mon, 28 Sep 2015 05:30:13 +0000 (15:30 +1000)]
Track peer sources with a dict, and don't exceed high water mark

8 years agoInitialize connection piece priorities lazily, and using a pool
Matt Joiner [Sat, 26 Sep 2015 07:27:35 +0000 (17:27 +1000)]
Initialize connection piece priorities lazily, and using a pool

8 years agoInclude num pieces in torrent status
Matt Joiner [Fri, 25 Sep 2015 12:05:32 +0000 (22:05 +1000)]
Include num pieces in torrent status

8 years agoAdd packed IP list
Matt Joiner [Wed, 23 Sep 2015 08:25:22 +0000 (18:25 +1000)]
Add packed IP list

This saves a lot of memory by allowing the IP blocklist to be mmap()ed in. In production with the latest level1 blocklist it's 35MB per process.

8 years agoDerp
Matt Joiner [Sun, 20 Sep 2015 11:09:55 +0000 (21:09 +1000)]
Derp

8 years agoDon't warn about zero port peers from trackers
Matt Joiner [Sun, 20 Sep 2015 11:09:10 +0000 (21:09 +1000)]
Don't warn about zero port peers from trackers

8 years agobencode: Decode very large integers as big.Int if they overflow int64
Matt Joiner [Sun, 20 Sep 2015 11:08:42 +0000 (21:08 +1000)]
bencode: Decode very large integers as big.Int if they overflow int64

8 years agoAvoid frequent allocation of piece request order iterator
Matt Joiner [Sun, 20 Sep 2015 01:29:52 +0000 (11:29 +1000)]
Avoid frequent allocation of piece request order iterator

8 years agoMerge pull request #30 from therewillbecode/patch-1
Matt Joiner [Thu, 17 Sep 2015 12:18:01 +0000 (22:18 +1000)]
Merge pull request #30 from therewillbecode/patch-1

Improved Word Flow

8 years agoImproved Word Flow
Tom [Thu, 17 Sep 2015 10:56:45 +0000 (11:56 +0100)]
Improved Word Flow

8 years agoTidy
Matt Joiner [Thu, 17 Sep 2015 02:54:03 +0000 (12:54 +1000)]
Tidy

8 years agoAdd a test for dropping a torrent before it gets the Info
Matt Joiner [Thu, 17 Sep 2015 02:53:52 +0000 (12:53 +1000)]
Add a test for dropping a torrent before it gets the Info

Really just to check the behaviour doesn't change, it was mentioned before but wasn't the actual cause of any problem.

8 years agoCount failed chunk sends against a connection
Matt Joiner [Thu, 17 Sep 2015 02:50:29 +0000 (12:50 +1000)]
Count failed chunk sends against a connection

8 years agoTweak logging
Matt Joiner [Thu, 17 Sep 2015 02:40:35 +0000 (12:40 +1000)]
Tweak logging

8 years agoReduce noise about zero port peers
Matt Joiner [Thu, 17 Sep 2015 02:39:51 +0000 (12:39 +1000)]
Reduce noise about zero port peers

8 years agoSome code missed in the last commit ಠ_ಠ
Matt Joiner [Sun, 6 Sep 2015 02:35:56 +0000 (12:35 +1000)]
Some code missed in the last commit ಠ_ಠ

8 years agoAllow subscribing to torrent piece state changes
Matt Joiner [Sun, 6 Sep 2015 02:33:22 +0000 (12:33 +1000)]
Allow subscribing to torrent piece state changes

8 years agoSome doc comments
Matt Joiner [Sun, 6 Sep 2015 02:31:23 +0000 (12:31 +1000)]
Some doc comments

8 years agofs: Update for changes in bazil.org/fuse
Matt Joiner [Sun, 23 Aug 2015 09:25:33 +0000 (19:25 +1000)]
fs: Update for changes in bazil.org/fuse

8 years agobencode: Remove trailing bytes checks, this broke the peer protocol and should be...
Matt Joiner [Sun, 23 Aug 2015 09:24:29 +0000 (19:24 +1000)]
bencode: Remove trailing bytes checks, this broke the peer protocol and should be a new API

8 years agoRevert "bencode: Trailing bytes on Unmarshal is an error"
Matt Joiner [Sun, 23 Aug 2015 09:10:22 +0000 (19:10 +1000)]
Revert "bencode: Trailing bytes on Unmarshal is an error"

This reverts commit ad73a0ea8958ed6cb15513798762be65e5c29568.

8 years agobencode: Simplify parse_int
Matt Joiner [Sun, 23 Aug 2015 07:51:24 +0000 (17:51 +1000)]
bencode: Simplify parse_int

8 years agobencode: Trailing bytes on Unmarshal is an error
Matt Joiner [Sun, 23 Aug 2015 07:47:01 +0000 (17:47 +1000)]
bencode: Trailing bytes on Unmarshal is an error

8 years agobencode: Don't allow extraneous trailing 'e's
Matt Joiner [Sun, 23 Aug 2015 07:45:59 +0000 (17:45 +1000)]
bencode: Don't allow extraneous trailing 'e's

8 years agobencode: Add tests for Unmarshalling trailing bytes, and extraneous 'e'
Matt Joiner [Sun, 23 Aug 2015 06:13:30 +0000 (16:13 +1000)]
bencode: Add tests for Unmarshalling trailing bytes, and extraneous 'e'

8 years agobencode: Fuzz
Matt Joiner [Sun, 23 Aug 2015 05:59:49 +0000 (15:59 +1000)]
bencode: Fuzz

8 years agoAdd Debug flag to Config
Matt Joiner [Sun, 23 Aug 2015 02:59:03 +0000 (12:59 +1000)]
Add Debug flag to Config

I'll use this to squash the noisy logging for people who don't care.

8 years agoAdd tests inspired by issue #27
Matt Joiner [Sun, 23 Aug 2015 02:50:32 +0000 (12:50 +1000)]
Add tests inspired by issue #27

8 years agoCode comment
Matt Joiner [Sun, 23 Aug 2015 02:49:35 +0000 (12:49 +1000)]
Code comment

8 years agoNeedlessly convoluted
Matt Joiner [Wed, 19 Aug 2015 03:29:01 +0000 (13:29 +1000)]
Needlessly convoluted

8 years agodht: Use new Msg.Args helper method
Matt Joiner [Mon, 17 Aug 2015 16:12:52 +0000 (02:12 +1000)]
dht: Use new Msg.Args helper method

8 years agodht: Remove redundant code which caused rare crash
Matt Joiner [Mon, 17 Aug 2015 16:12:27 +0000 (02:12 +1000)]
dht: Remove redundant code which caused rare crash

8 years agodht: Use passive from server config
Matt Joiner [Mon, 17 Aug 2015 16:11:48 +0000 (02:11 +1000)]
dht: Use passive from server config

8 years agodht: Improve on on Msg methods
Matt Joiner [Mon, 17 Aug 2015 16:11:09 +0000 (02:11 +1000)]
dht: Improve on on Msg methods

8 years agodht: BEP43
Matt Joiner [Mon, 17 Aug 2015 16:09:10 +0000 (02:09 +1000)]
dht: BEP43

8 years agodht: Revive the UnmarshalGetPeersResponse test
Matt Joiner [Mon, 17 Aug 2015 16:08:08 +0000 (02:08 +1000)]
dht: Revive the UnmarshalGetPeersResponse test

8 years agoRedo the compact peer types
Matt Joiner [Mon, 17 Aug 2015 09:52:47 +0000 (19:52 +1000)]
Redo the compact peer types

8 years agoUpload after a piece completes
Matt Joiner [Wed, 12 Aug 2015 07:11:14 +0000 (17:11 +1000)]
Upload after a piece completes

8 years agoAdd TestSeedAfterDownloading
Matt Joiner [Wed, 12 Aug 2015 06:51:12 +0000 (16:51 +1000)]
Add TestSeedAfterDownloading

8 years agoSeveral bad KRPC message are crying wolf
Matt Joiner [Wed, 5 Aug 2015 23:02:50 +0000 (09:02 +1000)]
Several bad KRPC message are crying wolf

8 years agodht: Support IPv6 compact peers
Matt Joiner [Wed, 5 Aug 2015 23:01:38 +0000 (09:01 +1000)]
dht: Support IPv6 compact peers

8 years agodht: Short circuit non-DHT traffic
Matt Joiner [Wed, 5 Aug 2015 22:59:30 +0000 (08:59 +1000)]
dht: Short circuit non-DHT traffic

8 years agoLog zero ports from trackers
Matt Joiner [Wed, 5 Aug 2015 22:58:13 +0000 (08:58 +1000)]
Log zero ports from trackers

8 years agoBack off on the kicked connections log
Matt Joiner [Wed, 5 Aug 2015 22:56:36 +0000 (08:56 +1000)]
Back off on the kicked connections log

8 years agoLog who's giving us zero ports over PEX
Matt Joiner [Wed, 5 Aug 2015 22:55:48 +0000 (08:55 +1000)]
Log who's giving us zero ports over PEX

In the long run this will help determine why this happens.

8 years agoutp.NewSocket now takes network parameter
Matt Joiner [Tue, 4 Aug 2015 16:51:40 +0000 (02:51 +1000)]
utp.NewSocket now takes network parameter

8 years agoClear piece touch flag from connection after a piece is hashed
Matt Joiner [Tue, 4 Aug 2015 16:43:53 +0000 (02:43 +1000)]
Clear piece touch flag from connection after a piece is hashed

8 years agoAdd an option to disable IPv6
Matt Joiner [Tue, 4 Aug 2015 16:41:50 +0000 (02:41 +1000)]
Add an option to disable IPv6

8 years agoReplacing pendingWrites WaitGroup with Mutex/Cond/int
Matt Joiner [Tue, 4 Aug 2015 16:40:46 +0000 (02:40 +1000)]
Replacing pendingWrites WaitGroup with Mutex/Cond/int

Apparently I've been using WaitGroups wrong all along.

8 years agoInvalid test
Matt Joiner [Tue, 4 Aug 2015 16:38:36 +0000 (02:38 +1000)]
Invalid test

The function is never exposed publicly or called without holding the client lock.

8 years agocmd/dht-secure-id
Matt Joiner [Tue, 4 Aug 2015 16:38:02 +0000 (02:38 +1000)]
cmd/dht-secure-id

8 years agodht: Expose SecureNodeId and NodeIdSecure
Matt Joiner [Tue, 4 Aug 2015 16:37:43 +0000 (02:37 +1000)]
dht: Expose SecureNodeId and NodeIdSecure

8 years agoImprove log message
Matt Joiner [Mon, 3 Aug 2015 15:33:50 +0000 (01:33 +1000)]
Improve log message

8 years agoDrop peers for sending too many unwanted pieces
Matt Joiner [Mon, 3 Aug 2015 15:32:45 +0000 (01:32 +1000)]
Drop peers for sending too many unwanted pieces

So the algorithm is now, drop the worst half if they get too old, and drop any connection if it's ratio is poor.

8 years agoLog errant unwanted piece rather than panic
Matt Joiner [Mon, 3 Aug 2015 15:29:40 +0000 (01:29 +1000)]
Log errant unwanted piece rather than panic

Eventually I'll work out what causes this, but for now it's incredibly rare.

8 years agodht: Count announce errors, don't log them
Matt Joiner [Mon, 3 Aug 2015 15:20:44 +0000 (01:20 +1000)]
dht: Count announce errors, don't log them

8 years agoFilter out DHT peers with port 0
Matt Joiner [Mon, 3 Aug 2015 15:20:10 +0000 (01:20 +1000)]
Filter out DHT peers with port 0

Probably not necessary now we ban the nodes that send them, but it's appropriate to check here too.

8 years agoFix crash if peer sends out of bounds HAVE message
Matt Joiner [Mon, 3 Aug 2015 15:17:32 +0000 (01:17 +1000)]
Fix crash if peer sends out of bounds HAVE message

8 years agoTighten up some potential leaks
Matt Joiner [Mon, 3 Aug 2015 15:15:09 +0000 (01:15 +1000)]
Tighten up some potential leaks

Based on some observations of lingering goroutines in unit tests.

8 years agoDrop connections that contributed to pieces that failed to hash
Matt Joiner [Mon, 3 Aug 2015 15:12:09 +0000 (01:12 +1000)]
Drop connections that contributed to pieces that failed to hash

There are peers out there that seem to intentionally spam bad data, and the same pieces will often fail continuously. This really puts a bee in their bonnet.

8 years agoAdd IPBlocklist option to Config, and test it's inherited by DHT
Matt Joiner [Mon, 3 Aug 2015 15:07:22 +0000 (01:07 +1000)]
Add IPBlocklist option to Config, and test it's inherited by DHT