Commit Graph

1776 Commits

Author SHA1 Message Date
Matt Joiner 7dec0a196d Count errors returned from connection.mainReadLoop 2018-02-13 00:56:21 +11:00
Matt Joiner 33bfa908d2 bencode.Decoder.Decode: Don't assume panic values are type error 2018-02-13 00:55:15 +11:00
Matt Joiner 70010ce691 Support IPv6 peers over PEX 2018-02-13 00:50:32 +11:00
Matt Joiner 39bde7237e Try to count IPv6 connections 2018-02-13 00:48:21 +11:00
Matt Joiner 4b5203851a bencode: Support unmarshalling strings into slices of kind Uint8 2018-02-13 00:44:05 +11:00
Matt Joiner eeaf9f67a9 tracker: Support peers6 key in http responses 2018-02-13 00:23:07 +11:00
Matt Joiner dd9244c01d bencode: Unmarshal now returns an error on unused trailing bytes 2018-02-13 00:21:28 +11:00
Matt Joiner 8e3aa89286 tracker: Export vars 2018-02-13 00:19:37 +11:00
Matt Joiner b33ce1e01b tracker: Move Peer into the correct file 2018-02-12 23:49:33 +11:00
Matt Joiner ce78248ba1 Update test trackers 2018-02-12 23:49:05 +11:00
Matt Joiner 6773fa9a7e Fix TestSetMaxEstablishedConn and allow it to be run with -count > 1
Similar changes should occur to other tests exporting StatusWriters.
2018-02-11 15:14:31 +11:00
Matt Joiner 57216bd299 Standardize on krpc types, and extend PEX message type for IPv6 2018-02-11 15:13:00 +11:00
Matt Joiner 8d1995c4d4 Support IPv6 blocklists
Existing packed blocklists need to be regenerated.
2018-02-11 15:11:26 +11:00
Matt Joiner 924b916b2a Expose Client.Closed 2018-02-08 23:57:53 +11:00
Matt Joiner 1f81f57b9c There was no error for missing file, and no way to close the mmap returned from iplist.MmapPacked
The function is also renamed due to the changed behaviour.
2018-02-08 23:57:35 +11:00
Matt Joiner fadbd68d99 Count peers not added because of bad addresses and rearrange method 2018-02-08 23:55:28 +11:00
Matt Joiner eb0f9ff813 Raise default torrent peers highwater to 500 2018-02-08 23:52:54 +11:00
Matt Joiner e3fdd4890e Simplify crypto select func 2018-02-08 23:52:31 +11:00
Matt Joiner 5023dcaa3a Fixes for non-pointer Bitmap corrupting state 2018-02-08 15:08:33 +11:00
Matt Joiner 15ed1bbd69 Remove uploadChunksPosted expvar
Use messageTypesPosted.Piece
2018-02-07 13:57:50 +11:00
Matt Joiner 05da46ddbb Raise the nominal max requests for connections that download lots of useful chunks
Massive speed increases for some connections.
2018-02-05 18:49:55 +11:00
Matt Joiner f4c03ee6ac Simplify the utpSocket interface definition 2018-02-05 18:03:27 +11:00
Matt Joiner 54f43419e2 Fix fast extension message type constants
iota isn't worth the trouble
2018-02-05 18:00:47 +11:00
Matt Joiner d5682e9cd0 Change a bunch of Stringer and status stuff
Cumulative interest time, download rate per connection, request low and high waters, peer extension bytes
2018-02-05 17:47:47 +11:00
Matt Joiner f57437201e Send bitfield messages before other initial messages 2018-02-05 17:41:53 +11:00
Matt Joiner 93e8d9bfaa Use stringer to generate peer_protocol.MessageType strings 2018-02-05 15:30:35 +11:00
Matt Joiner 20316e5af4 Support AllowedFast and enable fast extension 2018-02-05 00:18:38 +11:00
Matt Joiner 898e878c69 Aggressively wake Readers 2018-02-04 22:47:01 +11:00
Matt Joiner b2860bad21 Fix the connection completed string if peer sent HaveAll 2018-02-04 22:43:28 +11:00
Matt Joiner 2e36ad19d9 Finish mainReadLoop on Torrent closed 2018-02-04 19:14:46 +11:00
Matt Joiner 44e44637bf TODOs and comments 2018-02-04 19:14:07 +11:00
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