Commit Graph

2620 Commits

Author SHA1 Message Date
Matt Joiner a3bf8424a1 torrent.go: Alias peer_protocol as pp 2014-05-23 20:58:11 +10:00
Matt Joiner 51cbfdf676 Put interface assertion next to the asserted type 2014-05-23 00:38:07 +10:00
Matt Joiner 763e387c62 TorrentReadAt shouldn't care about verification state 2014-05-23 00:37:36 +10:00
Matt Joiner dd30d144ae Avoid rebuffering in peer_protocol.Decode 2014-05-23 00:36:47 +10:00
Matt Joiner 65fa317244 Some minor fiddling to announcing in the client 2014-05-23 00:35:24 +10:00
Matt Joiner f8b06ef65c The fuse library allocates a response data slice for us, so use it 2014-05-23 00:34:18 +10:00
Matt Joiner 96f85be99a ResponsiveDownloadStrategy will readahead blocks
Test peers don't play well with short "up request" buffers, so we need to fill
these with the most likely blocks to achieve maximum download speeds.
2014-05-23 00:33:07 +10:00
Matt Joiner 8022c09b90 client.go: Shorten module peer_protocol to pp 2014-05-21 18:01:58 +10:00
Matt Joiner fdcee11eb0 Shorten variable names in connectionLoop 2014-05-21 17:55:50 +10:00
Matt Joiner cc81bca617 Be more selective about when to replenish connection requests 2014-05-21 17:49:59 +10:00
Matt Joiner 309f70bcb5 Implement connection.{Cancel,Choke} 2014-05-21 17:49:28 +10:00
Matt Joiner ef9e334479 Allocate peer_protocol.Message on the stack in connectionLoop 2014-05-21 17:48:44 +10:00
Matt Joiner d16f444fa8 Support individual peer max requests 2014-05-21 17:47:42 +10:00
Matt Joiner ec77cb0ece Misc minor improvements 2014-05-21 17:42:06 +10:00
Matt Joiner 04879b0002 Add Client.DownloadStrategy; fix priority of incomplete pieces 2014-05-21 17:40:54 +10:00
Matt Joiner 2e4629abbc cmd/torrent: Add flags -disableTrackers and -seed 2014-05-21 17:38:09 +10:00
Matt Joiner 99b7ef4e42 Ininitialize the torrent.Priorities up front and do initial piece checks with a single goroutine 2014-05-21 17:37:31 +10:00
Matt Joiner 0f3c4cb3ec Add some String methods and contextual information in log messages 2014-05-21 00:52:49 +10:00
Matt Joiner 0dee5d9952 Make Request private 2014-04-16 21:13:44 +10:00
Matt Joiner 036fd126e8 Implement receiving cancel messages 2014-04-16 17:33:33 +10:00
Matt Joiner 8245f119ef TestUnmountWedged, fs.Destroy 2014-04-17 16:37:54 +10:00
Matt Joiner 1aa1063863 Big visibility/doc clean-up, and extract mmap_span package 2014-04-09 02:36:05 +10:00
Matt Joiner f1bf5a46a1 Check for asynchronous mount error after serving 2014-04-09 01:18:55 +10:00
Matt Joiner fc653a307b Break up torrentfs main(), it's too large 2014-04-09 01:18:29 +10:00
Matt Joiner 998dba34b8 Handle repeat SIGINT/SIGTERMs
Need to determine if there's a way to better interrupt the FS or if we have no control over that.
2014-04-09 01:17:53 +10:00
Matt Joiner 786952e4cd Add error handling to PrioritizeDataRegion as it's public facing API 2014-04-09 01:15:39 +10:00
Matt Joiner c1bf4de70f Mask EHOSTUNREACH on connect() 2014-04-08 19:40:10 +10:00
Matt Joiner 1415c0d824 goimports decided to reorganise imports 2014-04-08 19:39:34 +10:00
Matt Joiner a0a715c6f6 Fix calculation of request for torrent data offset 2014-04-08 16:45:33 +10:00
Matt Joiner 9ba3af19ba Break up client.go into several files and a few fixes
Suppress expected errors when initiating connections.
Add an explicit timeout to initiate connections.
Put a lock on closing a connection to prevent data race warnings.
2014-04-03 23:16:59 +11:00
Matt Joiner 8cb39521f2 Fix short read and report unexpected EOFs decoding peer protocol 2014-03-21 00:42:40 +11:00
Matt Joiner 34299483d2 TODO 2014-03-21 00:40:54 +11:00
Matt Joiner 236e12486b Lots of logging improvements 2014-03-21 00:14:17 +11:00
Matt Joiner ef4aa0d3f9 Add -listenAddr and actually listen in ./cmd/torrent 2014-03-21 00:13:32 +11:00
Matt Joiner a1b95d499d Send port on announces when possible 2014-03-21 00:12:53 +11:00
Matt Joiner 1b2a85600f Fix requests to other leechers 2014-03-21 00:11:49 +11:00
Matt Joiner 9e7caacbe3 Tidy up 2014-03-20 22:02:15 +11:00
Matt Joiner a07b53668f Fix races stopping clients and closing connections 2014-03-20 22:01:56 +11:00
Matt Joiner 1c95eda249 Test created torrent structure in current directory 2014-03-20 17:35:11 +11:00
Matt Joiner fa000c4f88 Improvements to pending chunks; extract testutil 2014-03-20 16:58:09 +11:00
Matt Joiner 771a08d4f4 Add a scrape command so I can work out if trackers are seeing my test clients
I don't even know if scrape is the right word.
2014-03-20 04:30:32 +11:00
Matt Joiner 9ee83455cf Various progress, particularly around the way data readiness is handled 2014-03-20 04:30:08 +11:00
Matt Joiner 7e2c384bd5 Fix buffer reuse bug and some formatting. 2014-03-20 01:54:18 +11:00
Matt Joiner 998fbeb0c6 Hunting for goroutine leaks
Start implementing Client.Stop().
2014-03-18 22:39:33 +11:00
Matt Joiner 2e81f914e7 Add a end-to-end test for torrentfs
Basic unchoking and uploading.
Accept incoming connections.
Break out torrentfs lib.
Fix and implement some protocol stuff.
2014-03-18 01:44:22 +11:00
Matt Joiner cbc65ac4c8 Add tracker_test 2014-03-17 02:31:06 +11:00
Matt Joiner 31530899e4 Make use of trackers 2014-03-17 02:30:10 +11:00
Matt Joiner e68d5fec1f Simplify the tracker.New interface, just take a string 2013-12-16 18:47:23 +11:00
Matt Joiner 99d2ced31c Tracker doc 2013-12-16 18:46:55 +11:00
Matt Joiner 5f093c3803 Fixes and tests for UDP tracker protocol 2013-12-14 22:21:45 +11:00