]> Sergey Matveev's repositories - btrtrc.git/log
btrtrc.git
7 years agoReader.SetReadahead can change readahead pieces
Matt Joiner [Mon, 24 Oct 2016 08:35:12 +0000 (19:35 +1100)]
Reader.SetReadahead can change readahead pieces

7 years agoOptimize piece priorities when reader position changes
Matt Joiner [Sun, 23 Oct 2016 05:33:26 +0000 (16:33 +1100)]
Optimize piece priorities when reader position changes

Gives a decent boost to throughput and reduces a lot of CPU when reading very quickly from Reader.

7 years agoAdd TODO item
Matt Joiner [Tue, 18 Oct 2016 14:38:54 +0000 (01:38 +1100)]
Add TODO item

7 years agoFix not working import
Thomas Maurice [Fri, 14 Oct 2016 18:07:44 +0000 (20:07 +0200)]
Fix not working import

7 years agoAdd download rate limiting
Matt Joiner [Mon, 10 Oct 2016 06:29:39 +0000 (17:29 +1100)]
Add download rate limiting

Fixes #121.

7 years agoMake newConnection a method on Client
Matt Joiner [Mon, 10 Oct 2016 05:55:56 +0000 (16:55 +1100)]
Make newConnection a method on Client

7 years agoSplit connection.rw into separate Reader and Writer
Matt Joiner [Mon, 10 Oct 2016 05:30:51 +0000 (16:30 +1100)]
Split connection.rw into separate Reader and Writer

This will make it easier to write hooks for Read and Write separately.

7 years agoFix Config.UploadRateLimiter comment
Matt Joiner [Mon, 10 Oct 2016 04:03:02 +0000 (15:03 +1100)]
Fix Config.UploadRateLimiter comment

7 years agoAdd really simple upload rate limiting and test
Matt Joiner [Mon, 10 Oct 2016 03:58:29 +0000 (14:58 +1100)]
Add really simple upload rate limiting and test

7 years agoImprove code comments
Matt Joiner [Mon, 10 Oct 2016 03:57:34 +0000 (14:57 +1100)]
Improve code comments

7 years agoReorder the fields of struct Client
Matt Joiner [Sun, 9 Oct 2016 13:04:14 +0000 (00:04 +1100)]
Reorder the fields of struct Client

7 years agoUpdate README.md
Matt Joiner [Thu, 6 Oct 2016 03:58:50 +0000 (14:58 +1100)]
Update README.md

The build status badge is not helpful due to the aggressive testing and badge caching.

7 years agoDefault to debug mode in client testing config
Matt Joiner [Wed, 5 Oct 2016 04:57:38 +0000 (15:57 +1100)]
Default to debug mode in client testing config

7 years agoDo chunk pooling at Torrent instead of connection level
Matt Joiner [Wed, 5 Oct 2016 04:57:00 +0000 (15:57 +1100)]
Do chunk pooling at Torrent instead of connection level

7 years agoSpeed up mse.handshake.establishS
Matt Joiner [Fri, 30 Sep 2016 02:14:34 +0000 (12:14 +1000)]
Speed up mse.handshake.establishS

Remove possible slice allocation, and avoid reflect.

7 years agopeer_protocol.Decoder.Decode: Avoid allocating another intermediate reader
Matt Joiner [Sun, 25 Sep 2016 00:31:43 +0000 (10:31 +1000)]
peer_protocol.Decoder.Decode: Avoid allocating another intermediate reader

On my system, BenchmarkConnectionMainReadLoop goes from 596 to 1311 MB/s.

7 years agofix unreadable id when started
Meng Zhuo [Wed, 21 Sep 2016 11:53:05 +0000 (19:53 +0800)]
fix unreadable id when started

7 years agofix dht-server cmd won't exit after Ctrl+C
Meng Zhuo [Wed, 21 Sep 2016 11:36:07 +0000 (19:36 +0800)]
fix dht-server cmd won't exit after Ctrl+C

7 years agoCreate missing intermediate directories in test
Matt Joiner [Wed, 21 Sep 2016 11:17:22 +0000 (21:17 +1000)]
Create missing intermediate directories in test

7 years agoFix Client.receiveSkeys
Matt Joiner [Wed, 21 Sep 2016 11:04:52 +0000 (21:04 +1000)]
Fix Client.receiveSkeys

Fixes #114. Loop variables in Go are ****ed.

7 years agoTidy up TestMultipleTorrentsWithEncryption test
Matt Joiner [Wed, 21 Sep 2016 11:02:18 +0000 (21:02 +1000)]
Tidy up TestMultipleTorrentsWithEncryption test

7 years agoAdd some more debug logging
Matt Joiner [Wed, 21 Sep 2016 11:00:18 +0000 (21:00 +1000)]
Add some more debug logging

7 years agoFormatting fixes
Matt Joiner [Tue, 20 Sep 2016 08:39:36 +0000 (18:39 +1000)]
Formatting fixes

7 years agoFixes for changes to metainfo.MetaInfo.UnmarshalInfo
Matt Joiner [Tue, 20 Sep 2016 08:39:07 +0000 (18:39 +1000)]
Fixes for changes to metainfo.MetaInfo.UnmarshalInfo

7 years agoAdd error return value to metainfo.MetaInfo.UnmarshalInfo
Matt Joiner [Tue, 20 Sep 2016 02:25:40 +0000 (12:25 +1000)]
Add error return value to metainfo.MetaInfo.UnmarshalInfo

Too many problems caused by bad info bytes in downstream projects.

7 years agoAdd a test case for #114 (#117)
Michael Howell [Fri, 16 Sep 2016 14:01:15 +0000 (07:01 -0700)]
Add a test case for #114 (#117)

7 years agoAdd Config.{Force,PreferNo}Encryption
Matt Joiner [Fri, 16 Sep 2016 02:42:41 +0000 (12:42 +1000)]
Add Config.{Force,PreferNo}Encryption

7 years agoMinor comments and test improvement
Matt Joiner [Fri, 16 Sep 2016 02:13:06 +0000 (12:13 +1000)]
Minor comments and test improvement

7 years agostorage: Move sqlite3 import to appropriate file
Matt Joiner [Fri, 16 Sep 2016 01:19:26 +0000 (11:19 +1000)]
storage: Move sqlite3 import to appropriate file

7 years agoComment on metainfo.PieceKey
Matt Joiner [Fri, 16 Sep 2016 01:18:36 +0000 (11:18 +1000)]
Comment on metainfo.PieceKey

7 years agoAdd note in README about the mobile branch
Matt Joiner [Tue, 13 Sep 2016 04:03:55 +0000 (14:03 +1000)]
Add note in README about the mobile branch

7 years agocmd/torrent: Fix progress bar for zero-length torrents
Matt Joiner [Mon, 12 Sep 2016 07:47:07 +0000 (17:47 +1000)]
cmd/torrent: Fix progress bar for zero-length torrents

7 years agoUse sync.pool for decode buffer
Ye Yin [Mon, 12 Sep 2016 07:10:11 +0000 (15:10 +0800)]
Use sync.pool for decode buffer

7 years agoRename some of the unexported file storage types
Matt Joiner [Mon, 12 Sep 2016 07:26:39 +0000 (17:26 +1000)]
Rename some of the unexported file storage types

7 years agoTest empty files and zero piece length for both file and mmap storage backends
Matt Joiner [Mon, 12 Sep 2016 07:11:32 +0000 (17:11 +1000)]
Test empty files and zero piece length for both file and mmap storage backends

7 years agoCreate zero-length files in the file storage when the torrent storage is opened
Matt Joiner [Mon, 12 Sep 2016 07:01:00 +0000 (17:01 +1000)]
Create zero-length files in the file storage when the torrent storage is opened

Fixes #111.

7 years agoFix issue #112
Matt Joiner [Mon, 12 Sep 2016 06:54:43 +0000 (16:54 +1000)]
Fix issue #112

7 years agoAdd test for issue #111 and #112
Matt Joiner [Mon, 12 Sep 2016 06:53:20 +0000 (16:53 +1000)]
Add test for issue #111 and #112

7 years agoAdd a benchmark for readMainLoop piece decoding
Matt Joiner [Sun, 11 Sep 2016 05:43:57 +0000 (15:43 +1000)]
Add a benchmark for readMainLoop piece decoding

7 years agoMove Client.connectionLoop to connection.mainReadLoop
Matt Joiner [Sun, 11 Sep 2016 04:32:56 +0000 (14:32 +1000)]
Move Client.connectionLoop to connection.mainReadLoop

7 years agoRemove unused trackerTier and shuffleTier
Matt Joiner [Sun, 11 Sep 2016 04:12:03 +0000 (14:12 +1000)]
Remove unused trackerTier and shuffleTier

7 years agoMove TorrentSpec stuff into its own file
Matt Joiner [Sun, 11 Sep 2016 04:09:40 +0000 (14:09 +1000)]
Move TorrentSpec stuff into its own file

7 years agoComment typo (#110)
Ben Gadbois [Tue, 6 Sep 2016 23:43:29 +0000 (16:43 -0700)]
Comment typo (#110)

7 years agoRelax the seeder torrent connection stats test
Matt Joiner [Fri, 2 Sep 2016 05:26:21 +0000 (15:26 +1000)]
Relax the seeder torrent connection stats test

The values have changed due to the recent storage change, I'm not sure why, and I don't know if it's important.

7 years agoRework storage interfaces to make them simpler to implement
Matt Joiner [Fri, 2 Sep 2016 05:10:57 +0000 (15:10 +1000)]
Rework storage interfaces to make them simpler to implement

This allows lots of behaviour to be baked into the new Client, Torrent and Piece wrappers, rather than duplicating (badly) them in all the backend implementations.

7 years agostorage.boltDB: Some comments, and use global completedValue
Matt Joiner [Wed, 31 Aug 2016 11:00:44 +0000 (21:00 +1000)]
storage.boltDB: Some comments, and use global completedValue

7 years agoImprove test reliability on Linux and reduce log noise in tests
Matt Joiner [Wed, 31 Aug 2016 10:14:57 +0000 (20:14 +1000)]
Improve test reliability on Linux and reduce log noise in tests

7 years agoExtract chunkSize as a const
Matt Joiner [Wed, 31 Aug 2016 08:04:11 +0000 (18:04 +1000)]
Extract chunkSize as a const

7 years agoPass seed option to Config for cmd/torrent (#108)
Matt Joiner [Wed, 31 Aug 2016 09:33:54 +0000 (19:33 +1000)]
Pass seed option to Config for cmd/torrent (#108)

7 years agoPass seed option to Config for cmd/torrent
Ye Yin [Wed, 31 Aug 2016 09:20:20 +0000 (17:20 +0800)]
Pass seed option to Config for cmd/torrent

7 years agoUncomment the error handling in storage.boltDBPiece.ReadAt
Matt Joiner [Wed, 31 Aug 2016 08:02:45 +0000 (18:02 +1000)]
Uncomment the error handling in storage.boltDBPiece.ReadAt

7 years agoAdd boltdb storage backend
Matt Joiner [Wed, 31 Aug 2016 07:48:50 +0000 (17:48 +1000)]
Add boltdb storage backend

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.