Commit Graph

1405 Commits

Author SHA1 Message Date
Matt Joiner 38048672a7 Rework locking in Client.acceptConnections 2016-07-06 00:38:43 +10:00
Matt Joiner 326b36545b Prepare to allow max conns per torrent to be configured 2016-07-05 16:23:17 +10:00
Matt Joiner 12191dbfa3 Add counters for uploads
Fixes #71.
2016-07-05 15:52:33 +10:00
Matt Joiner 12486412b3 Remove redundant check in Torrent.SetInfoBytes 2016-06-27 15:46:43 +10:00
Matt Joiner afc76861e0 Throw away Torrent display name when info becomes available 2016-06-27 15:46:27 +10:00
Matt Joiner 874bba43f8 Fix crash causing deadlock in connection writer when no messages have been posted yet 2016-06-27 15:45:15 +10:00
Matt Joiner 364f617ade Add metainfo.NewHashFromHex 2016-06-21 02:35:53 +10:00
Matt Joiner ce0a3d56f1 storage: Remove debug log 2016-06-20 18:21:16 +10:00
Matt Joiner d80d0db9d5 storage: Also use completion DB in mmap implementation 2016-06-20 18:20:59 +10:00
Matt Joiner 6b447c8d2b Track closing of outbound TCP connections
Got all inbound and outbound UTP, missed this one I think.
2016-06-20 17:51:40 +10:00
Matt Joiner cee200a5a2 Add piece completion storage
Toward fixing https://github.com/anacrolix/torrent/issues/50.
2016-06-20 17:51:05 +10:00
Matt Joiner b75e85d187 storage.MMapTorrent should not be exported 2016-06-20 16:11:43 +10:00
Matt Joiner 9b48d0c7a5 Suppress tracker scraping errors until I decide what to do with them
They're not really necessary, but I had them enabled while I rewrote the tracker scraper code.
2016-06-18 17:23:53 +10:00
Matt Joiner 1b3e37b9ed cmd/torrent: Remove unused "short" tag 2016-06-18 16:02:59 +10:00
Matt Joiner d20384b421 cmd/torrent-create: Improve spelling and descriptions 2016-06-16 12:27:49 +10:00
Alexey Kuznetsov ad5d5bc350 -a option (#86)
* add -a option

* name
2016-06-16 01:25:48 +10:00
Matt Joiner b84298351a Move a few methods to Torrent, and track how many DHT announces occur
I suspect that DHT announces may occur too regularly, or without a break for torrents that aren't able to get over the lower water pending peer mark.
2016-06-15 15:29:47 +10:00
Matt Joiner c2bdb31bb3 Client.announceTorrentDHT -> Torrent.announceDHT 2016-06-15 15:13:53 +10:00
Matt Joiner 727d002e5a bencode.Encoder: Unembed the Writer and wrap it in a minimal interface
I won't remove the bufio.Buffer for Marshal now, it isn't a performance issue as far as I can tell, and I'd have to fake Flush().
2016-06-15 15:09:34 +10:00
Matt Joiner ac3b40ace3 bencode: Remove private types encoder and decoder
Instead the functionality is exposed directly on the public types.
2016-06-15 15:00:51 +10:00
Matt Joiner d9b7e7f297 bencode.Unmarshal: Remove unnecessary intermediate bufio.Reader 2016-06-15 14:54:40 +10:00
Matt Joiner 9d1a33facc bencode: Unembed the Reader type, and minimize the interface surface
Want to remove some unnecessary allocations.
2016-06-15 14:51:58 +10:00
Matt Joiner 9e0cae9113 README: Improve the cmd/torrent doc 2016-06-01 22:44:22 +10:00
Matt Joiner 7123523634 Merge pull request #84 from gdouezangrard/master
fix disabling of global bootstrap servers for announce when the node table is empty
2016-06-01 12:12:38 +10:00
Guillaume Douézan-Grard 4d917b059c fix bootstrap from global servers disabling 2016-06-01 03:02:21 +02:00
Matt Joiner 6cac882030 Reduce the impact of preferring earlier pieces
I think urgent pieces at the end of a torrent were getting fairly starved.
2016-05-28 22:04:33 +10:00
Matt Joiner 060ff72175 Improve the logic for which address to use for DHT 2016-05-24 19:46:24 +10:00
Matt Joiner 7a4b491ede Tidy up the listen function 2016-05-24 19:45:42 +10:00
Matt Joiner 000f430105 Add tests for #81 2016-05-24 19:35:23 +10:00
Matt Joiner 0a9db65df1 Merge pull request #81 from lovedboy/master
fix listenedAddr  bug when TCP or UDP bind dynamic port
2016-05-24 19:09:57 +10:00
lovedboy ca8d9de944 add return when utpsock's err is not nil 2016-05-24 13:24:29 +08:00
lovedboy 0b36de4be9 Merge branch 'master' of https://github.com/lovedboy/torrent 2016-05-24 13:19:55 +08:00
lovedboy fd1b4dc489 listenedAddr fix when TCP or UDP bind dynamic port 2016-05-24 13:18:04 +08:00
Matt Joiner b55e67dc22 Ban IPs that contribute to failed piece checks 2016-05-24 02:09:47 +10:00
Matt Joiner d8dc3ad239 Torrent.MetaInfo: don't crash if info isn't available yet 2016-05-23 20:08:18 +10:00
Matt Joiner 56a89905b6 Update Torrent.wantPeersEvent when info is obtained 2016-05-23 11:11:56 +10:00
Matt Joiner b0923608bb Handle tracker announce prepare errors 2016-05-23 11:00:49 +10:00
Matt Joiner c6ec935e53 Update Torrent.wantPeersEvent in several places 2016-05-23 10:19:14 +10:00
Matt Joiner 5051d1dcd0 Add Torrent.AddTrackers 2016-05-23 10:18:58 +10:00
Matt Joiner abbbb6e115 cmd/torrent-metainfo-pprint: Add Announce and AnnounceList keys 2016-05-23 10:18:39 +10:00
Matt Joiner c5e0c806ea tracker: Skip any net errors to third party trackers 2016-05-23 09:29:14 +10:00
Matt Joiner 9df9fda397 Drop the lol://cheezburger tracker from the test torrent
Spams the logs too much.
2016-05-22 23:44:38 +10:00
Matt Joiner 512aa7ede4 Don't start tracker scrapers if trackers are disabled 2016-05-22 23:44:08 +10:00
Matt Joiner 7a60873ec8 Don't create an empty tracker URL if both AnnounceList and Announce are empty 2016-05-22 23:43:55 +10:00
Matt Joiner 20870ec4ff Rework torrent tracker scraping
New scrapers are added anytime trackers are added to a torrent. In the future they will also be stopped as soon as they're removed. All trackers are concurrently scraped, the old-style of sticking to one tracker that works is abandoned for now.
2016-05-22 22:45:08 +10:00
Matt Joiner 7f6f921aa9 Comment on tracker.AnnounceRequest.Event 2016-05-22 22:42:37 +10:00
Matt Joiner 2c5eb2ae43 tracker: Allow resolving announce URL host in advance, and passing the desired Host field for HTTP requests
Also did some clean-up of the announce code, the concept of a client is going away.
2016-05-20 00:48:46 +10:00
Matt Joiner 8cdcbe9d40 Fix the tracker method receivers and names 2016-05-19 23:58:00 +10:00
Matt Joiner 7600ac70e3 Move torrent tracker methods into torrent.go 2016-05-19 22:49:37 +10:00
Matt Joiner 73a648fb32 Torrent.writeStatus: Include human readable torrent size 2016-05-19 17:15:10 +10:00