]> Sergey Matveev's repositories - btrtrc.git/log
btrtrc.git
5 years agobencode: Avoid Value.Interface call testing for big.Int
Matt Joiner [Tue, 17 Jul 2018 11:25:15 +0000 (21:25 +1000)]
bencode: Avoid Value.Interface call testing for big.Int

Was resulting in significant allocation.

5 years agoDon't randomize chunk order for requestStrategy 3
Matt Joiner [Tue, 17 Jul 2018 05:08:46 +0000 (15:08 +1000)]
Don't randomize chunk order for requestStrategy 3

This should also reduce a lot of allocation.

5 years agoReduce default handshake timeout to 3s
Matt Joiner [Sun, 15 Jul 2018 03:01:22 +0000 (13:01 +1000)]
Reduce default handshake timeout to 3s

5 years agoCalculate peer priority lazily for worse conn comparison
Matt Joiner [Sun, 15 Jul 2018 02:57:52 +0000 (12:57 +1000)]
Calculate peer priority lazily for worse conn comparison

5 years agoFix doc comment
Matt Joiner [Sun, 15 Jul 2018 02:56:28 +0000 (12:56 +1000)]
Fix doc comment

5 years agoFix connection.utp
Matt Joiner [Sun, 15 Jul 2018 02:55:49 +0000 (12:55 +1000)]
Fix connection.utp

5 years agoTrack metadata chunks read with its own Count
Matt Joiner [Sun, 15 Jul 2018 00:09:58 +0000 (10:09 +1000)]
Track metadata chunks read with its own Count

5 years agoRewrite piece data decoding and relax test
Matt Joiner [Sat, 14 Jul 2018 01:50:43 +0000 (11:50 +1000)]
Rewrite piece data decoding and relax test

5 years agopeer_protocol: Add a test for receiving overlong piece data
Matt Joiner [Sat, 14 Jul 2018 01:37:56 +0000 (11:37 +1000)]
peer_protocol: Add a test for receiving overlong piece data

The chunk buffer pool decides the upper bound on chunk data len.

5 years agoSend extended message before fast/bitfield
Matt Joiner [Sat, 14 Jul 2018 01:28:54 +0000 (11:28 +1000)]
Send extended message before fast/bitfield

This is how Transmission does it.

5 years agoFix peer_protocol.Message.RequestSpec for Type Piece
Matt Joiner [Fri, 13 Jul 2018 11:33:21 +0000 (21:33 +1000)]
Fix peer_protocol.Message.RequestSpec for Type Piece

5 years agoAdd a test that short pieces are decoded correctly
Matt Joiner [Wed, 11 Jul 2018 23:54:06 +0000 (09:54 +1000)]
Add a test that short pieces are decoded correctly

5 years agoComments and trivial tweaks
Matt Joiner [Wed, 11 Jul 2018 23:42:00 +0000 (09:42 +1000)]
Comments and trivial tweaks

5 years agoAdd peer_protocol.Integer.Uint32
Matt Joiner [Wed, 11 Jul 2018 23:16:40 +0000 (09:16 +1000)]
Add peer_protocol.Integer.Uint32

5 years agoAdd peer_protocol.RequestSpec
Matt Joiner [Wed, 11 Jul 2018 23:16:17 +0000 (09:16 +1000)]
Add peer_protocol.RequestSpec

5 years agoChange pieceIndex to peer_protocol.Integer
Matt Joiner [Wed, 11 Jul 2018 23:15:15 +0000 (09:15 +1000)]
Change pieceIndex to peer_protocol.Integer

5 years agoMove back to net.IP for extended handshake message IPs
Matt Joiner [Wed, 11 Jul 2018 14:00:07 +0000 (00:00 +1000)]
Move back to net.IP for extended handshake message IPs

5 years agoDon't error on bencode dicts that can't be marshalled
Matt Joiner [Wed, 11 Jul 2018 05:33:41 +0000 (15:33 +1000)]
Don't error on bencode dicts that can't be marshalled

Have seen metainfo announce-lists that are lists of dicts. Possibly ignoring type errors with a tag would be smarter but I'm undecided.

5 years agoSupport marshalling bencode strings into byte arrays
Matt Joiner [Wed, 11 Jul 2018 05:22:29 +0000 (15:22 +1000)]
Support marshalling bencode strings into byte arrays

5 years agoDecide where to set proxy for HTTP trackers
Matt Joiner [Wed, 11 Jul 2018 05:10:58 +0000 (15:10 +1000)]
Decide where to set proxy for HTTP trackers

Remove old ClientConfig.setProxyURL, set this directly now through ClientConfig.TrackerHttpClient.Transport.Proxy (if your Client allows it).

5 years agoRemove debug log
Matt Joiner [Tue, 10 Jul 2018 03:14:39 +0000 (13:14 +1000)]
Remove debug log

5 years agoUse half open limit directly from Config
Matt Joiner [Tue, 10 Jul 2018 02:23:00 +0000 (12:23 +1000)]
Use half open limit directly from Config

5 years agoMake extended handshake a struct, and move a bunch of extended stuff into peer_protocol
Matt Joiner [Tue, 10 Jul 2018 02:20:36 +0000 (12:20 +1000)]
Make extended handshake a struct, and move a bunch of extended stuff into peer_protocol

5 years agoMove PEX stuff into peer_protocol
Matt Joiner [Tue, 10 Jul 2018 01:21:24 +0000 (11:21 +1000)]
Move PEX stuff into peer_protocol

5 years agoReinstate the reduce dial timeout and update some values
Matt Joiner [Tue, 10 Jul 2018 01:19:14 +0000 (11:19 +1000)]
Reinstate the reduce dial timeout and update some values

Fixes #263

5 years agobep40Priority: Include error in return
Matt Joiner [Tue, 10 Jul 2018 01:14:23 +0000 (11:14 +1000)]
bep40Priority: Include error in return

5 years agoAdd more worseConn comparisons
Matt Joiner [Mon, 9 Jul 2018 23:50:39 +0000 (09:50 +1000)]
Add more worseConn comparisons

Should fix #264.

5 years agoMore sortimports
Matt Joiner [Sat, 7 Jul 2018 01:40:06 +0000 (11:40 +1000)]
More sortimports

5 years agosortimports
Matt Joiner [Sat, 7 Jul 2018 01:36:58 +0000 (11:36 +1000)]
sortimports

5 years agoFix panic when failing to parse tracker URL
Matt Joiner [Sat, 7 Jul 2018 01:35:47 +0000 (11:35 +1000)]
Fix panic when failing to parse tracker URL

5 years agoComments and readability
Matt Joiner [Sat, 7 Jul 2018 01:33:48 +0000 (11:33 +1000)]
Comments and readability

5 years agoAdd torrent.InfoHash type alias
Matt Joiner [Sat, 7 Jul 2018 01:32:52 +0000 (11:32 +1000)]
Add torrent.InfoHash type alias

5 years agoExpose handshake stuff in peer_protocol
Matt Joiner [Sat, 7 Jul 2018 01:31:29 +0000 (11:31 +1000)]
Expose handshake stuff in peer_protocol

5 years agofs/test.sh: Add sudo before happy path umount again
Matt Joiner [Sat, 30 Jun 2018 12:03:29 +0000 (22:03 +1000)]
fs/test.sh: Add sudo before happy path umount again

5 years agoChange the duplicateRequestTimeout to 1s
Matt Joiner [Sat, 30 Jun 2018 11:10:48 +0000 (21:10 +1000)]
Change the duplicateRequestTimeout to 1s

5 years agoAssume connections have half the download bandwidth than calculated
Matt Joiner [Sat, 30 Jun 2018 11:10:23 +0000 (21:10 +1000)]
Assume connections have half the download bandwidth than calculated

5 years agoUse timers for duplicate requests
Matt Joiner [Fri, 29 Jun 2018 14:10:31 +0000 (00:10 +1000)]
Use timers for duplicate requests

Nothing was triggering request updates when timeouts expired. This is the simplest fix, no performance considered.

5 years agoRun fs/test.sh in a temporary directory and make it clean up
Matt Joiner [Fri, 29 Jun 2018 14:08:01 +0000 (00:08 +1000)]
Run fs/test.sh in a temporary directory and make it clean up

5 years agoMerge messageTypes{Sent,Posted} into torrent expvar
Matt Joiner [Fri, 29 Jun 2018 12:10:21 +0000 (22:10 +1000)]
Merge messageTypes{Sent,Posted} into torrent expvar

5 years agoMake requestStrategy 3 the default
Matt Joiner [Thu, 28 Jun 2018 02:06:21 +0000 (12:06 +1000)]
Make requestStrategy 3 the default

Fixes #253.

5 years agoFix panic in connection.iterPendingPieces when the info isn't available
Matt Joiner [Thu, 28 Jun 2018 01:12:49 +0000 (11:12 +1000)]
Fix panic in connection.iterPendingPieces when the info isn't available

Triggered by connection.iterUnbiasedPieceRequestOrder calling Torrent.numPieces. We shouldn't be iterating pieces when there's no info anyway, so don't yield any. Mentioned in https://github.com/anacrolix/torrent/issues/253#issuecomment-400350386.

5 years agoMissed deferring release of an exported status writer
Matt Joiner [Tue, 26 Jun 2018 11:19:49 +0000 (21:19 +1000)]
Missed deferring release of an exported status writer

5 years agoFix racy Torrent.wantConns check when adding connections
Matt Joiner [Tue, 26 Jun 2018 10:47:21 +0000 (20:47 +1000)]
Fix racy Torrent.wantConns check when adding connections

5 years agoAdd more context to an error
Matt Joiner [Tue, 26 Jun 2018 10:24:39 +0000 (20:24 +1000)]
Add more context to an error

5 years agoRework status export in tests to allow count > 1 without a server for every test
Matt Joiner [Tue, 26 Jun 2018 09:54:48 +0000 (19:54 +1000)]
Rework status export in tests to allow count > 1 without a server for every test

5 years agoDo requests synchronously, and don't request from hashing or queued pieces
Matt Joiner [Tue, 26 Jun 2018 04:51:55 +0000 (14:51 +1000)]
Do requests synchronously, and don't request from hashing or queued pieces

Calculating the desired state was a nice idea, but too hard to debug. This way should also be faster.

5 years agoCheck that chunks we request aren't being hashed or queued for hash
Matt Joiner [Tue, 26 Jun 2018 03:04:15 +0000 (13:04 +1000)]
Check that chunks we request aren't being hashed or queued for hash

5 years agoFix BenchmarkConnectionMainReadLoop
Matt Joiner [Mon, 25 Jun 2018 04:09:08 +0000 (14:09 +1000)]
Fix BenchmarkConnectionMainReadLoop

5 years agoRework stats for receiving chunks
Matt Joiner [Mon, 25 Jun 2018 04:06:30 +0000 (14:06 +1000)]
Rework stats for receiving chunks

Related to #253.

5 years agoRemove premature initialization of Torrent.lastRequested
Matt Joiner [Mon, 25 Jun 2018 04:03:22 +0000 (14:03 +1000)]
Remove premature initialization of Torrent.lastRequested

5 years agoDrop connections that send chunks we shouldn't receive
Matt Joiner [Sun, 24 Jun 2018 10:35:46 +0000 (20:35 +1000)]
Drop connections that send chunks we shouldn't receive

5 years agoAdd requestStrategy 3, which duplicates requests only after a timeout
Matt Joiner [Sun, 24 Jun 2018 10:04:31 +0000 (20:04 +1000)]
Add requestStrategy 3, which duplicates requests only after a timeout

Possible solution for #253.

5 years agoWrite received chunks that we don't have
Matt Joiner [Sun, 24 Jun 2018 09:40:53 +0000 (19:40 +1000)]
Write received chunks that we don't have

Chunks were discarded if they belong to unprioritized pieces, even if those pieces were previously prioritized. May be contributing to #253.

5 years agoRetain interest if requests are outstanding and don't clear peer requests if they...
Matt Joiner [Sat, 23 Jun 2018 12:32:11 +0000 (22:32 +1000)]
Retain interest if requests are outstanding and don't clear peer requests if they send not_interested

Apparent shortcomings found when trying new request algorithms.

5 years agoEnsure 64-bit alignment of ConnStats fields
Matt Joiner [Sat, 23 Jun 2018 08:33:56 +0000 (18:33 +1000)]
Ensure 64-bit alignment of ConnStats fields

Fixes #262.

5 years agoMerge branch 'dev'
Matt Joiner [Fri, 22 Jun 2018 07:43:51 +0000 (17:43 +1000)]
Merge branch 'dev'

5 years agoUpdate accept limit parameters
Matt Joiner [Fri, 22 Jun 2018 07:43:02 +0000 (17:43 +1000)]
Update accept limit parameters

5 years agoUse scope timer in Torrent.writeChunk
Matt Joiner [Thu, 21 Jun 2018 13:22:13 +0000 (23:22 +1000)]
Use scope timer in Torrent.writeChunk

5 years agomoving upnp to a separate repository
Denis Kuzmenok [Tue, 19 Jun 2018 12:49:20 +0000 (15:49 +0300)]
moving upnp to a separate repository

5 years agoImprove logging in a test
Matt Joiner [Sun, 17 Jun 2018 11:21:24 +0000 (21:21 +1000)]
Improve logging in a test

5 years agoDisable accept rate limiting by default in tests
Matt Joiner [Sun, 17 Jun 2018 11:20:41 +0000 (21:20 +1000)]
Disable accept rate limiting by default in tests

5 years agoFix multiLess.StrictNext
Matt Joiner [Sun, 17 Jun 2018 11:11:01 +0000 (21:11 +1000)]
Fix multiLess.StrictNext

5 years agoFix build error with recent go version
Matt Joiner [Tue, 12 Jun 2018 11:51:34 +0000 (21:51 +1000)]
Fix build error with recent go version

5 years agoAdd some tests for net.Addr.Network values in various situations
Matt Joiner [Sun, 17 Jun 2018 06:21:57 +0000 (16:21 +1000)]
Add some tests for net.Addr.Network values in various situations

5 years agobencode: Remove string allocation when parsing strings
Matt Joiner [Sun, 17 Jun 2018 06:21:04 +0000 (16:21 +1000)]
bencode: Remove string allocation when parsing strings

5 years agocmd/torrent-metainfo-pprint: Use bufio input and enable envpprof
Matt Joiner [Sun, 17 Jun 2018 06:20:02 +0000 (16:20 +1000)]
cmd/torrent-metainfo-pprint: Use bufio input and enable envpprof

5 years agoLog and handle error with bad tracker URLs
Matt Joiner [Sun, 17 Jun 2018 06:19:24 +0000 (16:19 +1000)]
Log and handle error with bad tracker URLs

5 years agoMove chunk expvars into torrent prefix
Matt Joiner [Sun, 17 Jun 2018 06:18:22 +0000 (16:18 +1000)]
Move chunk expvars into torrent prefix

5 years agoUse RLock for Client.WriteStatus
Matt Joiner [Sun, 17 Jun 2018 06:11:50 +0000 (16:11 +1000)]
Use RLock for Client.WriteStatus

5 years agoall: gofmt
ia [Sat, 16 Jun 2018 22:47:12 +0000 (00:47 +0200)]
all: gofmt

Run standard gofmt command on project root.

- go version go1.10.3 darwin/amd64

Signed-off-by: ia <isaac.ardis@gmail.com>
5 years agoRemove TestUTPRawConn
Matt Joiner [Sat, 16 Jun 2018 10:17:05 +0000 (20:17 +1000)]
Remove TestUTPRawConn

It's a bit racy and depends on flaky network. Something like this belongs in the utp package anyway.

5 years agoAdd connection.hasPreferredNetworkOver and friends
Matt Joiner [Sat, 16 Jun 2018 07:14:47 +0000 (17:14 +1000)]
Add connection.hasPreferredNetworkOver and friends

5 years agoFix some formatting of ConnStats fields
Matt Joiner [Sat, 16 Jun 2018 07:10:56 +0000 (17:10 +1000)]
Fix some formatting of ConnStats fields

5 years agoAdd multiLess and use it for worseConn
Matt Joiner [Sat, 16 Jun 2018 07:04:12 +0000 (17:04 +1000)]
Add multiLess and use it for worseConn

5 years agoFix some testing code for Config->ClientConfig
Matt Joiner [Sat, 16 Jun 2018 07:01:21 +0000 (17:01 +1000)]
Fix some testing code for Config->ClientConfig

5 years agoRework Torrent pending requests assertions
Matt Joiner [Sat, 16 Jun 2018 07:00:50 +0000 (17:00 +1000)]
Rework Torrent pending requests assertions

Should provide more info, and sooner for #249.

5 years agoAllow dropping connections to the same peer ID
Matt Joiner [Sat, 16 Jun 2018 06:40:37 +0000 (16:40 +1000)]
Allow dropping connections to the same peer ID

Necessary for a test that expects one connection to each other Client.

5 years agoTorrent.Stats: RLock instead of Lock
Matt Joiner [Sat, 16 Jun 2018 06:38:14 +0000 (16:38 +1000)]
Torrent.Stats: RLock instead of Lock

5 years agoAllow disabling accept limiting and modify some constants
Matt Joiner [Sat, 16 Jun 2018 06:37:13 +0000 (16:37 +1000)]
Allow disabling accept limiting and modify some constants

5 years agoClear accept limits when adding a new torrent
Matt Joiner [Sat, 16 Jun 2018 06:34:35 +0000 (16:34 +1000)]
Clear accept limits when adding a new torrent

5 years agoUpdate external use of ClientConfig
Matt Joiner [Sat, 16 Jun 2018 06:33:40 +0000 (16:33 +1000)]
Update external use of ClientConfig

5 years agoRename Config->ClientConfig and change how defaults work
Matt Joiner [Sat, 16 Jun 2018 06:30:04 +0000 (16:30 +1000)]
Rename Config->ClientConfig and change how defaults work

This is a very breaking change.

5 years agoAdd lots of new expvars and perf timers
Matt Joiner [Fri, 15 Jun 2018 12:42:05 +0000 (22:42 +1000)]
Add lots of new expvars and perf timers

5 years agoRemove old Client.dialTCP
Matt Joiner [Fri, 15 Jun 2018 12:39:37 +0000 (22:39 +1000)]
Remove old Client.dialTCP

5 years agoRate limit incoming IP prefixes
Matt Joiner [Fri, 15 Jun 2018 12:38:11 +0000 (22:38 +1000)]
Rate limit incoming IP prefixes

Lots of bad or dishonest incoming handshakes for unwanted torrents.

5 years agoUse DialContext for tcp again
Matt Joiner [Fri, 15 Jun 2018 04:34:58 +0000 (14:34 +1000)]
Use DialContext for tcp again

It got lost somewhere along the way.

5 years agoUpdate dial expvars
Matt Joiner [Fri, 15 Jun 2018 04:30:31 +0000 (14:30 +1000)]
Update dial expvars

5 years agoUpdate some tests now that adding connections is more reliable
Matt Joiner [Wed, 13 Jun 2018 12:02:30 +0000 (22:02 +1000)]
Update some tests now that adding connections is more reliable

5 years agoRemove excess newline from log call
Matt Joiner [Wed, 13 Jun 2018 00:56:09 +0000 (10:56 +1000)]
Remove excess newline from log call

5 years agoFix race condition in Client.ListenAddrs
Matt Joiner [Wed, 13 Jun 2018 00:53:38 +0000 (10:53 +1000)]
Fix race condition in Client.ListenAddrs

5 years agoAllow adding duplicate connections
Matt Joiner [Wed, 13 Jun 2018 00:53:11 +0000 (10:53 +1000)]
Allow adding duplicate connections

I believe this fixes a long-standing race condition when dropping connections to the same peer ID where Clients assume the peer has added connections in the same order. Further commits may address duplicate connections further.

5 years agoFix Count usage in benchmark
Matt Joiner [Tue, 12 Jun 2018 12:47:46 +0000 (22:47 +1000)]
Fix Count usage in benchmark

5 years agoEnsure ConnStats spew nicely
Matt Joiner [Tue, 12 Jun 2018 12:40:04 +0000 (22:40 +1000)]
Ensure ConnStats spew nicely

5 years agoFix build error with recent go version
Matt Joiner [Tue, 12 Jun 2018 11:51:34 +0000 (21:51 +1000)]
Fix build error with recent go version

5 years agoRemove unused log import
Matt Joiner [Tue, 12 Jun 2018 10:25:32 +0000 (20:25 +1000)]
Remove unused log import

5 years agoRemove duplicateClientConns expvar
Matt Joiner [Tue, 12 Jun 2018 10:23:26 +0000 (20:23 +1000)]
Remove duplicateClientConns expvar

5 years agoUpdate log call
Matt Joiner [Tue, 12 Jun 2018 10:22:54 +0000 (20:22 +1000)]
Update log call

5 years agoTrack ConnStats with atomics
Matt Joiner [Tue, 12 Jun 2018 10:21:53 +0000 (20:21 +1000)]
Track ConnStats with atomics

5 years agoMake download cancellable tests more reliable
Matt Joiner [Tue, 12 Jun 2018 10:19:53 +0000 (20:19 +1000)]
Make download cancellable tests more reliable

5 years agoFix crash adding peers when Torrent is closed
Matt Joiner [Tue, 12 Jun 2018 10:17:15 +0000 (20:17 +1000)]
Fix crash adding peers when Torrent is closed