Commit Graph

1388 Commits

Author SHA1 Message Date
Matt Joiner 1508e02935 Move peerGotPiece 2016-03-21 14:17:15 +11:00
Matt Joiner 125c864a8c Add some File method comments 2016-03-19 17:40:30 +11:00
Matt Joiner 409d3695a6 Favour earlier pieces slightly, helps with in-order downloads 2016-03-19 17:40:18 +11:00
Matt Joiner 4c3fffa097 Fix locks on Reader.SetReadahead 2016-03-19 17:39:56 +11:00
Matt Joiner b6cd456779 Use new missinggo.SplitHostMaybePort implementation 2016-03-15 21:32:47 +11:00
Matt Joiner 0d5502932d Track accepted connections 2016-03-06 17:26:04 +11:00
Matt Joiner f436c9c955 Use missinggo.Event to track Client closed 2016-03-05 19:36:21 +11:00
Matt Joiner c175fab5a6 Fix a UTP Conn leak, on unencrypted followup dial attempts
I would guess that TCP ones were cleaned up by GC.
2016-03-02 23:27:46 +11:00
Matt Joiner aed2b6b3cb Add Reader.Torrent() 2016-03-02 23:26:46 +11:00
Matt Joiner 67aea29ba9 Extend the timeout, drone.io is slow? 2016-02-26 22:18:08 +11:00
Matt Joiner e33006a419 Ignore the corner case when a piece is dropped from storage 2016-02-26 22:12:13 +11:00
Matt Joiner 811b460f1d dht: Use missinggo.Event for closing 2016-02-26 22:11:48 +11:00
Matt Joiner a8ad7dfd0e Add test checking that cancel works 2016-02-26 22:10:29 +11:00
Matt Joiner 5cc8d8a652 Catch error creating client in tests 2016-02-26 22:10:09 +11:00
Matt Joiner aa76d13ffd Fix bad DHT node in tests in constructed torrent 2016-02-24 21:57:30 +11:00
Matt Joiner 976510db60 Add DHT nodes from metainfo when added to Client 2016-02-24 21:56:50 +11:00
Matt Joiner 2fa233345e dht: Rename newDHTAddr->NewAddr, and clean up the interface 2016-02-24 02:02:33 +11:00
Matt Joiner 7b0b0f9bf9 dht: Rename dHTAddr to Addr 2016-02-24 01:50:15 +11:00
Matt Joiner 5665505dc7 Test that metainfo nodes are added to the DHT 2016-02-24 01:48:44 +11:00
Matt Joiner a04fb2ce26 metainfo: Check for error unmarshalling bad nodes contents from a metainfo 2016-02-23 23:53:39 +11:00
Matt Joiner 621ec7bac4 dht: Misc trivial improvements 2016-02-23 23:52:30 +11:00
Matt Joiner 9c7d3d4783 metainfo: Fix use of CastSlice when copying nodes 2016-02-23 22:47:41 +11:00
Matt Joiner d67379b3cb metainfo: Ensure that nodes encode correctly 2016-02-23 22:37:38 +11:00
Matt Joiner 752e884155 metainfo: Support nodes as []string or [](string, int64)
Fixes #65.
2016-02-23 22:28:23 +11:00
Matt Joiner b3a5591d14 metainfo: It looks like the "nodes" field of metainfo was never handled correctly, support []string instead of [][]string, fix tests 2016-02-23 22:04:06 +11:00
Matt Joiner 7ed81fa708 metainfo tests: Fix some naming conventions 2016-02-23 21:50:07 +11:00
Matt Joiner c0cef5274b bencode: Update some test code 2016-02-23 21:47:00 +11:00
Matt Joiner fd5da294ff bencode tests: Idiomatize identifier naming 2016-02-23 21:43:05 +11:00
Matt Joiner f470f04d8f bencode: Use the testdata convention in tests 2016-02-23 21:31:15 +11:00
Matt Joiner c03593bc01 Catch error creating new client in test 2016-02-22 14:30:02 +11:00
Matt Joiner c371502cb3 Fix failure to request data from peers if it goes missing after being downloaded during the same session
The chunks remained marked dirty, even after the piece was marked complete. So when the piece was not complete, there was nothing to do.
2016-02-22 03:23:49 +11:00
Matt Joiner fd37f5c24b fs: Fix what looks like a glaring mistake: If Seek failed on the torrent reader, it would have got stuck
Since Seek is artificial, and the offsets are usually checked in the caller, it looks like it never failed anyway.
2016-02-22 02:44:29 +11:00
Matt Joiner 5cfa8232ed Fix races in Reader 2016-02-22 02:42:01 +11:00
Matt Joiner 033c95d73b Add a client transfer test with limited file cache, and a second pass read 2016-02-22 02:41:07 +11:00
Matt Joiner ca5080a382 fs: Change listen addrs to localhost in tests
Seems to improve reliability. Maybe the missinggo.Addr{IP,Port} change did something.
2016-02-22 02:39:49 +11:00
Matt Joiner 815d118d6e fs: Tidy up tests 2016-02-22 02:38:52 +11:00
Matt Joiner c50742fdac Move exportClientStatus to testutil.ExportStatusWriter 2016-02-22 02:36:41 +11:00
Matt Joiner c184129865 Update Reader pos between reads 2016-02-22 00:32:02 +11:00
Matt Joiner fd42ed877f Don't run TestCompletedPieceWrongSize in parallel because it messes up logs 2016-02-22 00:31:06 +11:00
Matt Joiner c64ad19dbb Test a ton of permutations for readahead and responsive 2016-02-22 00:30:42 +11:00
Matt Joiner 4846021c0c Tidy up TestClientTransfer 2016-02-21 22:08:01 +11:00
Matt Joiner 61af11fddc Off by one error in torrent.pieceLength? 2016-02-21 17:25:47 +11:00
Matt Joiner 380dc7a2b4 Add peer_protocol.Integer.Int() 2016-02-21 17:25:26 +11:00
Matt Joiner 5b443fb63d Refresh all piece completion states when data is missing 2016-02-21 17:24:59 +11:00
Matt Joiner 99e9f41a33 Choke peers when we lose pieces they requested, and drop them if they request pieces we don't have 2016-02-21 17:22:55 +11:00
Matt Joiner 400fa1feaf Fix race updating piece priority when piece being read is unexpectedly unavailable 2016-02-21 03:33:39 +11:00
Matt Joiner e20858a1e8 Move dataReadAt to torrent.readAt, and do the waitNoPendingWrites check there 2016-02-21 03:32:59 +11:00
Matt Joiner dcdf85a474 Ditch the torrent stateMu for the client mutex 2016-02-21 03:31:50 +11:00
Matt Joiner f6472fc1fd Code comment 2016-02-20 14:41:04 +11:00
Matt Joiner 89ec237769 Improve log message 2016-02-20 14:40:55 +11:00