Commit Graph

1323 Commits

Author SHA1 Message Date
Matt Joiner e51cb07f6e Uncomment the error handling in storage.boltDBPiece.ReadAt 2016-08-31 18:02:45 +10:00
Matt Joiner 3c2db92a83 Add boltdb storage backend 2016-08-31 17:48:50 +10:00
Matt Joiner 945d982877 Comment on PiecePriorityNext 2016-08-30 16:55:50 +10:00
Matt Joiner 8b17d2a63a Rework Reader position changes affecting piece priorities
Torrent.updatePiecePriorities is always followed by Torrent.piecePriorityChanged, so move it into the former function. Also drop the separate mutex for Reader, and add a missing Reader.posChanged call.
2016-08-30 15:41:26 +10:00
Matt Joiner 6c15a030d6 Improve comments 2016-08-30 15:07:59 +10:00
Matt Joiner 792ab183e4 Add a benchmark for an observed slow case with Torrent.updatePiecePriorities 2016-08-30 14:21:50 +10:00
Matt Joiner 7557c9bd4e Only parse the config listen addr if we have to
This fixes a broken benchmark
2016-08-30 14:19:29 +10:00
Matt Joiner 6f7623ff3c Add missing error return check in benchmark 2016-08-30 14:09:01 +10:00
Matt Joiner 8fd5942722 Make bencode.Bytes work with pointer and nonpointer receivers 2016-08-26 20:29:29 +10:00
Matt Joiner 2a1cef7c9e Remove the InfoEx type, and don't generate its infohash on the fly
Fixes #106.
2016-08-26 20:29:05 +10:00
Matt Joiner 7b2561cea8 bencode: More renames 2016-08-26 14:51:38 +10:00
Matt Joiner ebdab2d9de Add bencode.Bytes 2016-08-26 14:51:09 +10:00
Matt Joiner f2cbc873a5 bencode: Rename a bunch of slug case stuff 2016-08-26 13:13:30 +10:00
Matt Joiner e6d7b52638 Speed up connection.lastHelpful
Moving to reflection and interfaces has made it a bottleneck.
2016-08-14 22:39:23 +10:00
Matt Joiner 0bd5bcd1a5 cmd/torrentfs: Ensure unmounting occurs for some errors
Restructured so other errors can be handled better too.
2016-08-02 11:19:41 +10:00
Matt Joiner 6065a55818 Fix some more races in the status writing 2016-08-02 11:18:33 +10:00
perses 39cf5a7fde fs: fix isSubPath for top-level directories (#105) 2016-08-01 23:56:56 +10:00
Matt Joiner 00f406753a Fix build error with missinggo.Sorted 2016-07-30 00:48:15 +10:00
Matt Joiner 534275b625 Always run seeder and leecher on the same ports, to flex dht.Socket.CloseNow 2016-07-30 00:42:22 +10:00
Matt Joiner 1ca2e7e95a Add some extra conditions to prevent network activity when a torrent is closed
From suggestions by @axet, this might be a thing sometimes.
2016-07-30 00:41:45 +10:00
Matt Joiner 4143b7470d Begin exposing all the magic that Client.WriteStatus has so people can parse Client state their own way
It wasn't possible to move Client.WriteStatus to an external package to verify it doesn't depend on same-package access to data because then it can't be used in the tests, and it's extremely useful there. So I've settled for not locking the Client, and trying to use all the public methods. It's a work in progress.
2016-07-30 00:37:52 +10:00
Alexey Kuznetsov 49315045a0 it is actually sha1 hash size 2016-07-29 22:50:58 +10:00
perses 7d1443f4eb torrentfs: fix panic when testPeer is not specified (#103) 2016-07-27 12:35:52 +10:00
Matt Joiner 174e7192b5 Merge pull request #101 from perses/master
dirwatch: fix panic when attemting to copy func into [20]byte
2016-07-27 12:13:41 +10:00
ctn a3739fc47c torrentfs: fix panic when testPeer is not specified 2016-07-26 23:30:40 +03:00
ctn 6525cf19f6 dirwatch: fix panic when attemting to copy func into [20]byte 2016-07-26 22:34:09 +03:00
Matt Joiner debcb10b08 Some comments helping to break up the blocks in testClientTransfer 2016-07-24 00:35:34 +10:00
Matt Joiner 3c75f68413 Kick connections that contribute the final piece of missing metadata that fails to validate
Failing to get metainfo was resetting Torrent.metadataBytes, which caused arriving metadata data to appear to belong to nonexistent pieces, despite passing the check that we'd in fact requested them from the sending connection. This was unnecessarily noisy. Instead return an error if we got all the data, but couldn't set the Torrent's info bytes, that should propagate out and cause the connection that contributed the final missing piece to be dropped. This will at least provide some improved resistance to unfriendly behaviour on the network.
2016-07-24 00:34:40 +10:00
Matt Joiner 14e10ad58d Use utp.Socket.CloseNow to close a Client's uTP socket on Close
Fixes https://github.com/anacrolix/utp/issues/15.
2016-07-24 00:24:44 +10:00
Matt Joiner b98c1a7edc dht: Add counters for writes and write errors 2016-07-23 22:39:06 +10:00
Matt Joiner 980cd69ab2 Break up the DHT announcer code into smaller functions, and add a 5 minute delay between announces 2016-07-23 22:38:31 +10:00
Matt Joiner 5cc735ef32 Merge pull request #99 from hustcat/magnet
Add Announce when AnnounceList is nil
2016-07-22 19:58:32 +10:00
Ye Yin 6a2137f2b6 Add Announce when AnnounceList is nil 2016-07-22 15:16:11 +08:00
Matt Joiner 1e8c6808b2 Improve readability of tracker status line 2016-07-14 13:08:52 +10:00
Matt Joiner f5d58b3dc6 Unused *Client argument to Torrent.writeStatus 2016-07-12 21:23:20 +10:00
Matt Joiner 192bb829fb Remove duplicate seeder stat test assertions 2016-07-12 18:09:24 +10:00
Matt Joiner 29844b8b6c Few slices name changes 2016-07-12 17:49:00 +10:00
Matt Joiner a1ba463750 Fix issue #97 2016-07-12 16:45:22 +10:00
Matt Joiner 507daba528 Rework tracker scraper code to allow tracker stats
Inspired by @axet's work.
2016-07-12 16:44:06 +10:00
Matt Joiner 6e399e8f50 Add test for issue #97 2016-07-12 16:42:54 +10:00
Matt Joiner fbe0ded844 Add connection read stats 2016-07-12 16:42:04 +10:00
Matt Joiner a4e140b939 New slices package 2016-07-12 16:40:14 +10:00
Matt Joiner 7f6b9dbf7a Remove unnecessary log in test 2016-07-11 15:03:29 +10:00
Matt Joiner 8d0bd910a7 List implemented BEPs
Fix issue #93.
2016-07-11 13:53:00 +10:00
Matt Joiner 6cdb542dea Remove broken coverage link from README 2016-07-11 13:12:52 +10:00
Matt Joiner 4e0b4c4321 Add axet's projects to README
Fixes #94.
2016-07-11 13:12:20 +10:00
Matt Joiner f055abe2fc Fix issue #96
In the native file-based storage, mark pieces incomplete if the necessary file data is missing, or there's a read error on a piece.
2016-07-10 23:03:59 +10:00
Matt Joiner 9943fc3c58 Improve the log message when piece reads fail 2016-07-10 23:01:17 +10:00
Matt Joiner 363f042b95 Piece offset computed incorrectly in Reader.readOnceAt
Possibly it was only wrong on the last piece in rare circumstances.
2016-07-10 23:00:52 +10:00
Matt Joiner 0dbb943bc7 Skeleton TestMain
Used with manual inspection of process after tests finish.
2016-07-10 22:58:43 +10:00