Commit Graph

2087 Commits

Author SHA1 Message Date
Matt Joiner 195695042d Add requestStrategy 3, which duplicates requests only after a timeout
Possible solution for #253.
2018-06-24 20:04:31 +10:00
Matt Joiner d2602c7935 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.
2018-06-24 19:40:53 +10:00
Matt Joiner ad03e64722 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.
2018-06-23 22:32:11 +10:00
Matt Joiner 159c4a0e28 Ensure 64-bit alignment of ConnStats fields
Fixes #262.
2018-06-23 18:33:56 +10:00
Matt Joiner fefeef4ee9 Merge branch 'dev' 2018-06-22 17:43:51 +10:00
Matt Joiner 70093a4db3 Update accept limit parameters 2018-06-22 17:43:02 +10:00
Matt Joiner 96050948c2 Use scope timer in Torrent.writeChunk 2018-06-21 23:22:13 +10:00
Denis Kuzmenok 62637ce52d moving upnp to a separate repository 2018-06-19 23:00:19 +10:00
Matt Joiner 802e121a64 Improve logging in a test 2018-06-17 21:21:24 +10:00
Matt Joiner 0f5a2f0c05 Disable accept rate limiting by default in tests 2018-06-17 21:20:41 +10:00
Matt Joiner c1d1082136 Fix multiLess.StrictNext 2018-06-17 21:11:01 +10:00
Matt Joiner 0ea4383efc Fix build error with recent go version 2018-06-17 17:12:06 +10:00
Matt Joiner 4939dd4e57 Add some tests for net.Addr.Network values in various situations 2018-06-17 16:21:57 +10:00
Matt Joiner c5cc570e42 bencode: Remove string allocation when parsing strings 2018-06-17 16:21:04 +10:00
Matt Joiner 2b1068885c cmd/torrent-metainfo-pprint: Use bufio input and enable envpprof 2018-06-17 16:20:02 +10:00
Matt Joiner 4fafad46b2 Log and handle error with bad tracker URLs 2018-06-17 16:19:24 +10:00
Matt Joiner 3a17708c78 Move chunk expvars into torrent prefix 2018-06-17 16:18:22 +10:00
Matt Joiner f137bfdd61 Use RLock for Client.WriteStatus 2018-06-17 16:11:50 +10:00
ia fd7b23e527 all: gofmt
Run standard gofmt command on project root.

- go version go1.10.3 darwin/amd64

Signed-off-by: ia <isaac.ardis@gmail.com>
2018-06-17 15:49:58 +10:00
Matt Joiner 68e88977d5 Remove TestUTPRawConn
It's a bit racy and depends on flaky network. Something like this belongs in the utp package anyway.
2018-06-16 20:17:05 +10:00
Matt Joiner 4c471be802 Add connection.hasPreferredNetworkOver and friends 2018-06-16 17:14:47 +10:00
Matt Joiner 7a5aa2c42f Fix some formatting of ConnStats fields 2018-06-16 17:10:56 +10:00
Matt Joiner 8732aa9cf1 Add multiLess and use it for worseConn 2018-06-16 17:04:12 +10:00
Matt Joiner 2852fee357 Fix some testing code for Config->ClientConfig 2018-06-16 17:01:21 +10:00
Matt Joiner 174120e1e8 Rework Torrent pending requests assertions
Should provide more info, and sooner for #249.
2018-06-16 17:00:50 +10:00
Matt Joiner 0caafd8e87 Allow dropping connections to the same peer ID
Necessary for a test that expects one connection to each other Client.
2018-06-16 16:40:37 +10:00
Matt Joiner 0f90af85f1 Torrent.Stats: RLock instead of Lock 2018-06-16 16:38:14 +10:00
Matt Joiner 70dfc1f518 Allow disabling accept limiting and modify some constants 2018-06-16 16:37:13 +10:00
Matt Joiner 0854161e99 Clear accept limits when adding a new torrent 2018-06-16 16:34:35 +10:00
Matt Joiner cee8e3b9f9 Update external use of ClientConfig 2018-06-16 16:33:40 +10:00
Matt Joiner e97f487d2e Rename Config->ClientConfig and change how defaults work
This is a very breaking change.
2018-06-16 16:30:04 +10:00
Matt Joiner ad5e44eaf5 Add lots of new expvars and perf timers 2018-06-15 22:42:05 +10:00
Matt Joiner 81dcb9b779 Remove old Client.dialTCP 2018-06-15 22:39:37 +10:00
Matt Joiner 8acfc5149b Rate limit incoming IP prefixes
Lots of bad or dishonest incoming handshakes for unwanted torrents.
2018-06-15 22:38:11 +10:00
Matt Joiner 2fb1c022f5 Use DialContext for tcp again
It got lost somewhere along the way.
2018-06-15 14:34:58 +10:00
Matt Joiner fd0fb0051b Update dial expvars 2018-06-15 14:30:31 +10:00
Matt Joiner c9187bf736 Update some tests now that adding connections is more reliable 2018-06-13 22:02:30 +10:00
Matt Joiner a1d2a32b20 Remove excess newline from log call 2018-06-13 10:56:09 +10:00
Matt Joiner da4a6503c2 Fix race condition in Client.ListenAddrs 2018-06-13 10:53:38 +10:00
Matt Joiner 90f84bda71 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.
2018-06-13 10:53:11 +10:00
Matt Joiner 5412eef6da Fix Count usage in benchmark 2018-06-12 22:47:46 +10:00
Matt Joiner 5cb73d6a37 Ensure ConnStats spew nicely 2018-06-12 22:40:04 +10:00
Matt Joiner 224522545b Fix build error with recent go version 2018-06-12 21:51:34 +10:00
Matt Joiner 22a939fb02 Remove unused log import 2018-06-12 20:25:32 +10:00
Matt Joiner 817344d630 Remove duplicateClientConns expvar 2018-06-12 20:23:26 +10:00
Matt Joiner 856d5083b5 Update log call 2018-06-12 20:22:54 +10:00
Matt Joiner 360e1dbdd1 Track ConnStats with atomics 2018-06-12 20:21:53 +10:00
Matt Joiner 2007f2c234 Make download cancellable tests more reliable 2018-06-12 20:19:53 +10:00
Matt Joiner a287d069a4 Fix crash adding peers when Torrent is closed 2018-06-12 20:17:15 +10:00
Matt Joiner b024e1cff6 Remove unnecessary use of go keyword 2018-06-12 20:16:17 +10:00