Matt Joiner
e0c2265cb0
Support sending HaveAll
2018-02-04 19:10:25 +11:00
Matt Joiner
ec7b90db45
connections should not be added if the Torrent is closed
2018-02-04 13:00:08 +11:00
Matt Joiner
ea8659c951
Move initiateConn and openNewConns onto Torrent
2018-02-04 12:59:23 +11:00
Matt Joiner
64d13d86a6
Tickle sleeping writers when closing connections
...
This prevents them sleeping for an indefinite period (although something seemed to wake them eventually).
2018-02-03 15:44:03 +11:00
Matt Joiner
e1ea10fa2d
Wasn't recording posted message stats
2018-02-03 15:29:06 +11:00
Matt Joiner
efecf88d3c
Use flip buffering for connection writing
2018-02-03 15:09:38 +11:00
Matt Joiner
86aabb081c
Share the post write buffer with the synchronous one in the connection writer
...
This should prevent messages posted while generating synchronous messages don't get out of order.
2018-02-03 14:40:03 +11:00
Matt Joiner
9b1a769bef
Move extended message handling into its own method
2018-02-03 14:06:10 +11:00
Matt Joiner
085e676ef0
Generate default peerExtensionBytes using helpers
2018-02-03 13:36:17 +11:00
Matt Joiner
738a75bc1c
Prepare to support sending reject messages
2018-02-03 13:35:09 +11:00
Matt Joiner
9f2a7ec3e4
Fix peerExtensionBytes.SetBit
2018-02-03 13:29:48 +11:00
Matt Joiner
e67b85215c
Piece.everHashed is replaced by storageCompletionOk
2018-02-03 12:14:39 +11:00
Matt Joiner
f23d097502
Include closed connections in dirtiers
2018-02-03 12:08:16 +11:00
Matt Joiner
5fcb920f96
Use new logging in connection.go
2018-02-03 12:06:52 +11:00
Matt Joiner
9567aa901c
Add missing increments to some stats
2018-02-03 11:53:11 +11:00
Matt Joiner
5a4e8cd4c5
Rename and rearrange some conn stats
2018-02-03 00:41:13 +11:00
Matt Joiner
ffe778392c
request can be made from Reject and Cancel messages too
2018-02-02 23:56:06 +11:00
Matt Joiner
89b17c4372
Try to print something useful for MessageType panics
2018-02-02 21:52:57 +11:00
Matt Joiner
b610107d8d
Break up peer_protocol into several files
2018-02-02 21:29:57 +11:00
Matt Joiner
6441e98f62
Implement go vet recommendations
2018-02-02 19:28:09 +11:00
Matt Joiner
7a95714df2
Factor out connection.onReadRequest
2018-02-02 19:19:14 +11:00
Matt Joiner
fe991128ed
Rework connection stat reconciliation with Torrent and refactor doppleganger handling
2018-02-02 19:07:20 +11:00
Matt Joiner
b0c1f99509
Merge a bunch of stuff into ConnStats and refactor connection.upload
2018-02-02 19:04:56 +11:00
Matt Joiner
c9507786f2
Count requested chunk lengths
...
Have seen some very ridiculous lengths causing data read errors
2018-02-02 16:06:24 +11:00
Matt Joiner
8a43910e2d
connection.writer wasn't checking closed state
2018-02-02 13:36:18 +11:00
Matt Joiner
7b037cd024
Missed sendChunk invocation change
2018-02-02 13:34:35 +11:00
Matt Joiner
97ffe39561
Move sendChunk onto connection
2018-02-02 13:26:04 +11:00
Matt Joiner
186c5df3d3
When seeding, connections are not just useful when they're interested
...
Improves peer selection when seeding is enabled, we're still downloading.
2018-02-01 18:49:53 +11:00
Matt Joiner
2166bf1ec0
Some changes to status output
2018-02-01 18:45:58 +11:00
Matt Joiner
1e9f342a15
Merge piece and chunk iter inputs to nextRequestState
...
This will allow the iterator to filter chunks for request strategies.
2018-02-01 16:14:13 +11:00
Matt Joiner
3217c5012a
Code comments
2018-02-01 14:46:48 +11:00
Matt Joiner
9387e60999
Track concurrent requests across connections
...
In preparation for some more request strategy options
2018-02-01 14:46:03 +11:00
Matt Joiner
45aff24188
TestClientTransferRateLimitedUpload: Export client status
2018-02-01 14:43:57 +11:00
Matt Joiner
1a7708b484
sortimports
2018-01-31 16:42:40 +11:00
Matt Joiner
eb448d132d
Update context imports
2018-01-31 16:42:26 +11:00
Matt Joiner
64c40a45b4
Fix panic in benchmark caused by new logging
2018-01-29 19:16:55 +11:00
Matt Joiner
ceaf5a2360
Add some sanity checks to priorities extracted from Torrent.pendingPieces
2018-01-29 18:22:21 +11:00
Matt Joiner
50c1cdb601
Some test tidying and improvements
2018-01-29 18:22:21 +11:00
Matt Joiner
77806c1f49
More development of the new logging interface
2018-01-29 18:22:21 +11:00
Matt Joiner
ef4c0f1413
Add Torrent.Stats.ConnectedSeeders
...
Fixes #231
2018-01-29 18:22:21 +11:00
Matt Joiner
9a6f88b0fd
Update README.md
...
Few small nitpicks.
2018-01-28 18:43:16 +11:00
Matt Joiner
d6111a228c
Update README.md
...
Big changes to description, links, and downstream projects
2018-01-28 18:37:06 +11:00
Matt Joiner
04428fbdd1
Update README.md
...
Reorder the badges, I want to direct more people to the Gitter chat.
2018-01-28 17:43:28 +11:00
Matt Joiner
53e32ca9dd
Start using new log package
2018-01-28 16:07:11 +11:00
Matt Joiner
5ef22a978b
Synchronize piece completion on piece hash failure
...
Pieces that were unknown, remained unknown despite hashing for that very reason.
2018-01-28 16:02:14 +11:00
Matt Joiner
906d3bc5bb
Include completion known in PieceState
2018-01-28 15:58:55 +11:00
Matt Joiner
de928be582
Remove premature update to piece priority after piece is completed
...
This should have prevented Torrent.piecePriorityChanged from being called, meaning requests for the completed piece were not canceled, and the piece remained in connection's piece request queue, which meant wasted effort downloading chunks for an already acquired piece.
Thanks to @elgatito for discovering the issue.
2018-01-28 15:52:14 +11:00
Matt Joiner
e08d11a4b9
Update Client.newConnection with changed rateLimitedReader interface
2018-01-28 15:42:37 +11:00
Matt Joiner
00d9883ee0
Fix download rate limiter and add test
2018-01-28 15:28:45 +11:00
Matt Joiner
37272a391b
Avoid race in test
2018-01-27 14:31:46 +11:00