]> Sergey Matveev's repositories - btrtrc.git/log
btrtrc.git
7 years agoComment on PiecePriorityNext
Matt Joiner [Tue, 30 Aug 2016 06:55:50 +0000 (16:55 +1000)]
Comment on PiecePriorityNext

7 years agoRework Reader position changes affecting piece priorities
Matt Joiner [Tue, 30 Aug 2016 05:41:26 +0000 (15:41 +1000)]
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.

7 years agoImprove comments
Matt Joiner [Tue, 30 Aug 2016 05:07:59 +0000 (15:07 +1000)]
Improve comments

7 years agoAdd a benchmark for an observed slow case with Torrent.updatePiecePriorities
Matt Joiner [Tue, 30 Aug 2016 04:21:50 +0000 (14:21 +1000)]
Add a benchmark for an observed slow case with Torrent.updatePiecePriorities

7 years agoOnly parse the config listen addr if we have to
Matt Joiner [Tue, 30 Aug 2016 04:19:29 +0000 (14:19 +1000)]
Only parse the config listen addr if we have to

This fixes a broken benchmark

7 years agoAdd missing error return check in benchmark
Matt Joiner [Tue, 30 Aug 2016 04:09:01 +0000 (14:09 +1000)]
Add missing error return check in benchmark

7 years agoMake bencode.Bytes work with pointer and nonpointer receivers
Matt Joiner [Fri, 26 Aug 2016 10:29:29 +0000 (20:29 +1000)]
Make bencode.Bytes work with pointer and nonpointer receivers

7 years agoRemove the InfoEx type, and don't generate its infohash on the fly
Matt Joiner [Fri, 26 Aug 2016 10:29:05 +0000 (20:29 +1000)]
Remove the InfoEx type, and don't generate its infohash on the fly

Fixes #106.

7 years agobencode: More renames
Matt Joiner [Fri, 26 Aug 2016 04:51:38 +0000 (14:51 +1000)]
bencode: More renames

7 years agoAdd bencode.Bytes
Matt Joiner [Fri, 26 Aug 2016 04:51:09 +0000 (14:51 +1000)]
Add bencode.Bytes

7 years agobencode: Rename a bunch of slug case stuff
Matt Joiner [Fri, 26 Aug 2016 03:13:30 +0000 (13:13 +1000)]
bencode: Rename a bunch of slug case stuff

7 years agoSpeed up connection.lastHelpful
Matt Joiner [Sun, 14 Aug 2016 12:39:23 +0000 (22:39 +1000)]
Speed up connection.lastHelpful

Moving to reflection and interfaces has made it a bottleneck.

7 years agocmd/torrentfs: Ensure unmounting occurs for some errors
Matt Joiner [Tue, 2 Aug 2016 01:19:41 +0000 (11:19 +1000)]
cmd/torrentfs: Ensure unmounting occurs for some errors

Restructured so other errors can be handled better too.

7 years agoFix some more races in the status writing
Matt Joiner [Tue, 2 Aug 2016 01:18:33 +0000 (11:18 +1000)]
Fix some more races in the status writing

7 years agofs: fix isSubPath for top-level directories (#105)
perses [Mon, 1 Aug 2016 13:56:56 +0000 (16:56 +0300)]
fs: fix isSubPath for top-level directories (#105)

7 years agoFix build error with missinggo.Sorted
Matt Joiner [Fri, 29 Jul 2016 14:48:15 +0000 (00:48 +1000)]
Fix build error with missinggo.Sorted

7 years agoAlways run seeder and leecher on the same ports, to flex dht.Socket.CloseNow
Matt Joiner [Fri, 29 Jul 2016 14:42:22 +0000 (00:42 +1000)]
Always run seeder and leecher on the same ports, to flex dht.Socket.CloseNow

7 years agoAdd some extra conditions to prevent network activity when a torrent is closed
Matt Joiner [Fri, 29 Jul 2016 14:41:45 +0000 (00:41 +1000)]
Add some extra conditions to prevent network activity when a torrent is closed

From suggestions by @axet, this might be a thing sometimes.

7 years agoBegin exposing all the magic that Client.WriteStatus has so people can parse Client...
Matt Joiner [Fri, 29 Jul 2016 14:37:52 +0000 (00:37 +1000)]
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.

7 years agoit is actually sha1 hash size
Alexey Kuznetsov [Sun, 24 Jul 2016 17:26:30 +0000 (20:26 +0300)]
it is actually sha1 hash size

7 years agotorrentfs: fix panic when testPeer is not specified (#103)
perses [Wed, 27 Jul 2016 02:35:52 +0000 (05:35 +0300)]
torrentfs: fix panic when testPeer is not specified (#103)

7 years agoMerge pull request #101 from perses/master
Matt Joiner [Wed, 27 Jul 2016 02:13:41 +0000 (12:13 +1000)]
Merge pull request #101 from perses/master

dirwatch: fix panic when attemting to copy func into [20]byte

7 years agotorrentfs: fix panic when testPeer is not specified
ctn [Tue, 26 Jul 2016 20:30:40 +0000 (23:30 +0300)]
torrentfs: fix panic when testPeer is not specified

7 years agodirwatch: fix panic when attemting to copy func into [20]byte
ctn [Tue, 26 Jul 2016 19:34:09 +0000 (22:34 +0300)]
dirwatch: fix panic when attemting to copy func into [20]byte

7 years agoSome comments helping to break up the blocks in testClientTransfer
Matt Joiner [Sat, 23 Jul 2016 14:35:34 +0000 (00:35 +1000)]
Some comments helping to break up the blocks in testClientTransfer

7 years agoKick connections that contribute the final piece of missing metadata that fails to...
Matt Joiner [Sat, 23 Jul 2016 14:34:40 +0000 (00:34 +1000)]
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.

7 years agoUse utp.Socket.CloseNow to close a Client's uTP socket on Close
Matt Joiner [Sat, 23 Jul 2016 14:24:44 +0000 (00:24 +1000)]
Use utp.Socket.CloseNow to close a Client's uTP socket on Close

Fixes https://github.com/anacrolix/utp/issues/15.

7 years agodht: Add counters for writes and write errors
Matt Joiner [Sat, 23 Jul 2016 12:39:06 +0000 (22:39 +1000)]
dht: Add counters for writes and write errors

7 years agoBreak up the DHT announcer code into smaller functions, and add a 5 minute delay...
Matt Joiner [Sat, 23 Jul 2016 12:38:31 +0000 (22:38 +1000)]
Break up the DHT announcer code into smaller functions, and add a 5 minute delay between announces

7 years agoMerge pull request #99 from hustcat/magnet
Matt Joiner [Fri, 22 Jul 2016 09:58:32 +0000 (19:58 +1000)]
Merge pull request #99 from hustcat/magnet

Add Announce when AnnounceList is nil

7 years agoAdd Announce when AnnounceList is nil
Ye Yin [Fri, 22 Jul 2016 07:16:11 +0000 (15:16 +0800)]
Add Announce when AnnounceList is nil

7 years agoImprove readability of tracker status line
Matt Joiner [Thu, 14 Jul 2016 03:08:52 +0000 (13:08 +1000)]
Improve readability of tracker status line

7 years agoUnused *Client argument to Torrent.writeStatus
Matt Joiner [Tue, 12 Jul 2016 11:23:20 +0000 (21:23 +1000)]
Unused *Client argument to Torrent.writeStatus

7 years agoRemove duplicate seeder stat test assertions
Matt Joiner [Tue, 12 Jul 2016 08:09:24 +0000 (18:09 +1000)]
Remove duplicate seeder stat test assertions

7 years agoFew slices name changes
Matt Joiner [Tue, 12 Jul 2016 07:49:00 +0000 (17:49 +1000)]
Few slices name changes

7 years agoFix issue #97
Matt Joiner [Tue, 12 Jul 2016 06:45:22 +0000 (16:45 +1000)]
Fix issue #97

7 years agoRework tracker scraper code to allow tracker stats
Matt Joiner [Tue, 12 Jul 2016 06:44:06 +0000 (16:44 +1000)]
Rework tracker scraper code to allow tracker stats

Inspired by @axet's work.

7 years agoAdd test for issue #97
Matt Joiner [Tue, 12 Jul 2016 06:42:54 +0000 (16:42 +1000)]
Add test for issue #97

7 years agoAdd connection read stats
Matt Joiner [Tue, 12 Jul 2016 06:42:04 +0000 (16:42 +1000)]
Add connection read stats

7 years agoNew slices package
Matt Joiner [Tue, 12 Jul 2016 06:40:14 +0000 (16:40 +1000)]
New slices package

7 years agoRemove unnecessary log in test
Matt Joiner [Mon, 11 Jul 2016 05:03:29 +0000 (15:03 +1000)]
Remove unnecessary log in test

7 years agoList implemented BEPs
Matt Joiner [Mon, 11 Jul 2016 03:52:51 +0000 (13:52 +1000)]
List implemented BEPs

Fix issue #93.

7 years agoRemove broken coverage link from README
Matt Joiner [Mon, 11 Jul 2016 03:12:52 +0000 (13:12 +1000)]
Remove broken coverage link from README

7 years agoAdd axet's projects to README
Matt Joiner [Mon, 11 Jul 2016 03:12:20 +0000 (13:12 +1000)]
Add axet's projects to README

Fixes #94.

7 years agoFix issue #96
Matt Joiner [Sun, 10 Jul 2016 13:03:59 +0000 (23:03 +1000)]
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.

7 years agoImprove the log message when piece reads fail
Matt Joiner [Sun, 10 Jul 2016 13:01:17 +0000 (23:01 +1000)]
Improve the log message when piece reads fail

7 years agoPiece offset computed incorrectly in Reader.readOnceAt
Matt Joiner [Sun, 10 Jul 2016 13:00:52 +0000 (23:00 +1000)]
Piece offset computed incorrectly in Reader.readOnceAt

Possibly it was only wrong on the last piece in rare circumstances.

7 years agoSkeleton TestMain
Matt Joiner [Sun, 10 Jul 2016 12:58:43 +0000 (22:58 +1000)]
Skeleton TestMain

Used with manual inspection of process after tests finish.

7 years agoRework the client transfer test to allow non-piece-based leecher storage
Matt Joiner [Sun, 10 Jul 2016 05:01:08 +0000 (15:01 +1000)]
Rework the client transfer test to allow non-piece-based leecher storage

In preparation for tests for data going missing for the file-based storages. Issue #96

7 years agoBring back log message when a piece read fails unexpectedly
Matt Joiner [Sun, 10 Jul 2016 04:00:25 +0000 (14:00 +1000)]
Bring back log message when a piece read fails unexpectedly

7 years agoMove issue #95 tests into their own file
Matt Joiner [Fri, 8 Jul 2016 14:36:53 +0000 (00:36 +1000)]
Move issue #95 tests into their own file

7 years agoFix issue #95: Closing torrent storage also closed client storage for some storage...
Matt Joiner [Fri, 8 Jul 2016 14:36:32 +0000 (00:36 +1000)]
Fix issue #95: Closing torrent storage also closed client storage for some storage types

7 years agoAdd a test for issue #95
Matt Joiner [Fri, 8 Jul 2016 14:28:12 +0000 (00:28 +1000)]
Add a test for issue #95

7 years agometainfo: Move method in wrong file
Matt Joiner [Fri, 8 Jul 2016 14:12:32 +0000 (00:12 +1000)]
metainfo: Move method in wrong file

7 years agometainfo.Info.BuildFromFilePath: Ensure stable file ordering
Matt Joiner [Thu, 7 Jul 2016 09:40:26 +0000 (19:40 +1000)]
metainfo.Info.BuildFromFilePath: Ensure stable file ordering

Spotted by @axet, with precedent in Transmission.

7 years agoSolve the mystery bug with TestMaxEstablishedConns
Matt Joiner [Thu, 7 Jul 2016 04:49:18 +0000 (14:49 +1000)]
Solve the mystery bug with TestMaxEstablishedConns

Adding Torrent by infohash wasn't triggering connections to be accepted, when both TCP and uTP were enabled.

7 years agoRevert "Revert "TestSetMaxEstablishedConn does now work with utp""
Matt Joiner [Thu, 7 Jul 2016 04:16:06 +0000 (14:16 +1000)]
Revert "Revert "TestSetMaxEstablishedConn does now work with utp""

This reverts commit 9b3869f3c53e65d0c42527c76504c14bdff068be.

7 years agomissinggo.Sort->SortSlice
Matt Joiner [Thu, 7 Jul 2016 04:14:59 +0000 (14:14 +1000)]
missinggo.Sort->SortSlice

7 years agoRevert "TestSetMaxEstablishedConn does now work with utp"
Matt Joiner [Wed, 6 Jul 2016 04:05:03 +0000 (14:05 +1000)]
Revert "TestSetMaxEstablishedConn does now work with utp"

This reverts commit eb1be48cc6431cb380abbe11af6e72bbcec47b06.

7 years agoImprove logging heuristic for sending chunks of pieces that go missing
Matt Joiner [Wed, 6 Jul 2016 04:03:11 +0000 (14:03 +1000)]
Improve logging heuristic for sending chunks of pieces that go missing

7 years agommap storage: Close pieceCompletion on Close
Matt Joiner [Wed, 6 Jul 2016 04:02:15 +0000 (14:02 +1000)]
mmap storage: Close pieceCompletion on Close

7 years agostorage: Move pieceCompletion interface into correct file
Matt Joiner [Wed, 6 Jul 2016 03:38:16 +0000 (13:38 +1000)]
storage: Move pieceCompletion interface into correct file

7 years agoTestSetMaxEstablishedConn does now work with utp
Matt Joiner [Wed, 6 Jul 2016 01:05:04 +0000 (11:05 +1000)]
TestSetMaxEstablishedConn does now work with utp

I think dialing out from a utp.Socket before its reader has initialized may be the cause. Either way moving the addPeers to after all the Clients are initialized has worked around it as a side effect.

7 years agoUse addClientPeer helper in tests
Matt Joiner [Tue, 5 Jul 2016 22:31:30 +0000 (08:31 +1000)]
Use addClientPeer helper in tests

7 years agoAdd more thorough tests for Torrent.SetMaxEstablishedConns
Matt Joiner [Tue, 5 Jul 2016 22:30:34 +0000 (08:30 +1000)]
Add more thorough tests for Torrent.SetMaxEstablishedConns

7 years agoAdd Torrent.SetMaxEstablishedConns
Matt Joiner [Tue, 5 Jul 2016 14:42:16 +0000 (00:42 +1000)]
Add Torrent.SetMaxEstablishedConns

7 years agoRework locking in Client.acceptConnections
Matt Joiner [Tue, 5 Jul 2016 14:38:43 +0000 (00:38 +1000)]
Rework locking in Client.acceptConnections

7 years agoPrepare to allow max conns per torrent to be configured
Matt Joiner [Tue, 5 Jul 2016 06:23:17 +0000 (16:23 +1000)]
Prepare to allow max conns per torrent to be configured

7 years agoAdd counters for uploads
Matt Joiner [Tue, 5 Jul 2016 05:52:33 +0000 (15:52 +1000)]
Add counters for uploads

Fixes #71.

7 years agoRemove redundant check in Torrent.SetInfoBytes
Matt Joiner [Mon, 27 Jun 2016 05:46:43 +0000 (15:46 +1000)]
Remove redundant check in Torrent.SetInfoBytes

7 years agoThrow away Torrent display name when info becomes available
Matt Joiner [Mon, 27 Jun 2016 05:46:27 +0000 (15:46 +1000)]
Throw away Torrent display name when info becomes available

7 years agoFix crash causing deadlock in connection writer when no messages have been posted yet
Matt Joiner [Mon, 27 Jun 2016 05:45:15 +0000 (15:45 +1000)]
Fix crash causing deadlock in connection writer when no messages have been posted yet

7 years agoAdd metainfo.NewHashFromHex
Matt Joiner [Mon, 20 Jun 2016 16:35:53 +0000 (02:35 +1000)]
Add metainfo.NewHashFromHex

7 years agostorage: Remove debug log
Matt Joiner [Mon, 20 Jun 2016 08:21:16 +0000 (18:21 +1000)]
storage: Remove debug log

7 years agostorage: Also use completion DB in mmap implementation
Matt Joiner [Mon, 20 Jun 2016 08:20:59 +0000 (18:20 +1000)]
storage: Also use completion DB in mmap implementation

7 years agoTrack closing of outbound TCP connections
Matt Joiner [Mon, 20 Jun 2016 07:51:40 +0000 (17:51 +1000)]
Track closing of outbound TCP connections

Got all inbound and outbound UTP, missed this one I think.

7 years agoAdd piece completion storage
Matt Joiner [Mon, 20 Jun 2016 07:51:05 +0000 (17:51 +1000)]
Add piece completion storage

Toward fixing https://github.com/anacrolix/torrent/issues/50.

7 years agostorage.MMapTorrent should not be exported
Matt Joiner [Mon, 20 Jun 2016 06:11:43 +0000 (16:11 +1000)]
storage.MMapTorrent should not be exported

7 years agoSuppress tracker scraping errors until I decide what to do with them
Matt Joiner [Sat, 18 Jun 2016 07:23:53 +0000 (17:23 +1000)]
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.

7 years agocmd/torrent: Remove unused "short" tag
Matt Joiner [Sat, 18 Jun 2016 06:02:59 +0000 (16:02 +1000)]
cmd/torrent: Remove unused "short" tag

7 years agocmd/torrent-create: Improve spelling and descriptions
Matt Joiner [Thu, 16 Jun 2016 02:27:49 +0000 (12:27 +1000)]
cmd/torrent-create: Improve spelling and descriptions

7 years ago-a option (#86)
Alexey Kuznetsov [Wed, 15 Jun 2016 15:25:48 +0000 (18:25 +0300)]
-a option (#86)

* add -a option

* name

7 years agoMove a few methods to Torrent, and track how many DHT announces occur
Matt Joiner [Wed, 15 Jun 2016 05:29:47 +0000 (15:29 +1000)]
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.

7 years agoClient.announceTorrentDHT -> Torrent.announceDHT
Matt Joiner [Wed, 15 Jun 2016 05:13:53 +0000 (15:13 +1000)]
Client.announceTorrentDHT -> Torrent.announceDHT

7 years agobencode.Encoder: Unembed the Writer and wrap it in a minimal interface
Matt Joiner [Wed, 15 Jun 2016 05:09:34 +0000 (15:09 +1000)]
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().

7 years agobencode: Remove private types encoder and decoder
Matt Joiner [Wed, 15 Jun 2016 05:00:51 +0000 (15:00 +1000)]
bencode: Remove private types encoder and decoder

Instead the functionality is exposed directly on the public types.

7 years agobencode.Unmarshal: Remove unnecessary intermediate bufio.Reader
Matt Joiner [Wed, 15 Jun 2016 04:54:40 +0000 (14:54 +1000)]
bencode.Unmarshal: Remove unnecessary intermediate bufio.Reader

7 years agobencode: Unembed the Reader type, and minimize the interface surface
Matt Joiner [Wed, 15 Jun 2016 04:51:58 +0000 (14:51 +1000)]
bencode: Unembed the Reader type, and minimize the interface surface

Want to remove some unnecessary allocations.

8 years agoREADME: Improve the cmd/torrent doc
Matt Joiner [Wed, 1 Jun 2016 12:44:22 +0000 (22:44 +1000)]
README: Improve the cmd/torrent doc

8 years agoMerge pull request #84 from gdouezangrard/master
Matt Joiner [Wed, 1 Jun 2016 02:12:38 +0000 (12:12 +1000)]
Merge pull request #84 from gdouezangrard/master

fix disabling of global bootstrap servers for announce when the node table is empty

8 years agofix bootstrap from global servers disabling
Guillaume Douézan-Grard [Wed, 1 Jun 2016 01:02:21 +0000 (03:02 +0200)]
fix bootstrap from global servers disabling

8 years agoReduce the impact of preferring earlier pieces
Matt Joiner [Sat, 28 May 2016 12:04:33 +0000 (22:04 +1000)]
Reduce the impact of preferring earlier pieces

I think urgent pieces at the end of a torrent were getting fairly starved.

8 years agoImprove the logic for which address to use for DHT
Matt Joiner [Tue, 24 May 2016 09:46:24 +0000 (19:46 +1000)]
Improve the logic for which address to use for DHT

8 years agoTidy up the listen function
Matt Joiner [Tue, 24 May 2016 09:45:42 +0000 (19:45 +1000)]
Tidy up the listen function

8 years agoAdd tests for #81
Matt Joiner [Tue, 24 May 2016 09:35:23 +0000 (19:35 +1000)]
Add tests for #81

8 years agoMerge pull request #81 from lovedboy/master
Matt Joiner [Tue, 24 May 2016 09:09:57 +0000 (19:09 +1000)]
Merge pull request #81 from lovedboy/master

fix listenedAddr  bug when TCP or UDP bind dynamic port

8 years agoadd return when utpsock's err is not nil
lovedboy [Tue, 24 May 2016 05:24:29 +0000 (13:24 +0800)]
add return when utpsock's err is not nil

8 years agoMerge branch 'master' of https://github.com/lovedboy/torrent
lovedboy [Tue, 24 May 2016 05:19:55 +0000 (13:19 +0800)]
Merge branch 'master' of https://github.com/lovedboy/torrent

8 years agolistenedAddr fix when TCP or UDP bind dynamic port
lovedboy [Tue, 24 May 2016 05:18:04 +0000 (13:18 +0800)]
listenedAddr fix when TCP or UDP bind dynamic port

8 years agoBan IPs that contribute to failed piece checks
Matt Joiner [Mon, 23 May 2016 16:09:47 +0000 (02:09 +1000)]
Ban IPs that contribute to failed piece checks