]> Sergey Matveev's repositories - btrtrc.git/log
btrtrc.git
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

8 years agoTorrent.MetaInfo: don't crash if info isn't available yet
Matt Joiner [Mon, 23 May 2016 10:08:18 +0000 (20:08 +1000)]
Torrent.MetaInfo: don't crash if info isn't available yet

8 years agoUpdate Torrent.wantPeersEvent when info is obtained
Matt Joiner [Mon, 23 May 2016 01:11:56 +0000 (11:11 +1000)]
Update Torrent.wantPeersEvent when info is obtained

8 years agoHandle tracker announce prepare errors
Matt Joiner [Mon, 23 May 2016 01:00:49 +0000 (11:00 +1000)]
Handle tracker announce prepare errors

8 years agoUpdate Torrent.wantPeersEvent in several places
Matt Joiner [Mon, 23 May 2016 00:19:14 +0000 (10:19 +1000)]
Update Torrent.wantPeersEvent in several places

8 years agoAdd Torrent.AddTrackers
Matt Joiner [Mon, 23 May 2016 00:18:58 +0000 (10:18 +1000)]
Add Torrent.AddTrackers

8 years agocmd/torrent-metainfo-pprint: Add Announce and AnnounceList keys
Matt Joiner [Mon, 23 May 2016 00:18:39 +0000 (10:18 +1000)]
cmd/torrent-metainfo-pprint: Add Announce and AnnounceList keys

8 years agotracker: Skip any net errors to third party trackers
Matt Joiner [Sun, 22 May 2016 23:29:14 +0000 (09:29 +1000)]
tracker: Skip any net errors to third party trackers

8 years agoDrop the lol://cheezburger tracker from the test torrent
Matt Joiner [Sun, 22 May 2016 13:44:38 +0000 (23:44 +1000)]
Drop the lol://cheezburger tracker from the test torrent

Spams the logs too much.

8 years agoDon't start tracker scrapers if trackers are disabled
Matt Joiner [Sun, 22 May 2016 13:44:08 +0000 (23:44 +1000)]
Don't start tracker scrapers if trackers are disabled

8 years agoDon't create an empty tracker URL if both AnnounceList and Announce are empty
Matt Joiner [Sun, 22 May 2016 13:43:55 +0000 (23:43 +1000)]
Don't create an empty tracker URL if both AnnounceList and Announce are empty

8 years agoRework torrent tracker scraping
Matt Joiner [Sun, 22 May 2016 12:45:08 +0000 (22:45 +1000)]
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.

8 years agoComment on tracker.AnnounceRequest.Event
Matt Joiner [Sun, 22 May 2016 12:42:37 +0000 (22:42 +1000)]
Comment on tracker.AnnounceRequest.Event

8 years agotracker: Allow resolving announce URL host in advance, and passing the desired Host...
Matt Joiner [Thu, 19 May 2016 14:48:46 +0000 (00:48 +1000)]
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.

8 years agoFix the tracker method receivers and names
Matt Joiner [Thu, 19 May 2016 13:58:00 +0000 (23:58 +1000)]
Fix the tracker method receivers and names

8 years agoMove torrent tracker methods into torrent.go
Matt Joiner [Thu, 19 May 2016 12:49:37 +0000 (22:49 +1000)]
Move torrent tracker methods into torrent.go

8 years agoTorrent.writeStatus: Include human readable torrent size
Matt Joiner [Thu, 19 May 2016 07:15:10 +0000 (17:15 +1000)]
Torrent.writeStatus: Include human readable torrent size

8 years agoBreak out KRPC stuff from dht into new package
Matt Joiner [Tue, 17 May 2016 06:40:08 +0000 (16:40 +1000)]
Break out KRPC stuff from dht into new package

8 years agodht.Server.query: Return nil Transaction if there's an error
Matt Joiner [Tue, 17 May 2016 06:07:49 +0000 (16:07 +1000)]
dht.Server.query: Return nil Transaction if there's an error

8 years agodht: Stop processing packet if server closes after unmarshalling
Matt Joiner [Tue, 17 May 2016 06:07:03 +0000 (16:07 +1000)]
dht: Stop processing packet if server closes after unmarshalling

8 years agodht: Don't contact nodes with an IP containing a leading octet of 0
Matt Joiner [Tue, 17 May 2016 06:06:18 +0000 (16:06 +1000)]
dht: Don't contact nodes with an IP containing a leading octet of 0

8 years agoImprove dht.Transaction.SetResponseHandler comment
Matt Joiner [Tue, 17 May 2016 06:04:33 +0000 (16:04 +1000)]
Improve dht.Transaction.SetResponseHandler comment

8 years agoImprove the note about chunk writing concurrency
Matt Joiner [Mon, 16 May 2016 16:12:06 +0000 (02:12 +1000)]
Improve the note about chunk writing concurrency

Everytime I see memory spike I suspect this, and it isn't it.

8 years agoChanges to missinggo resource package
Matt Joiner [Mon, 16 May 2016 12:32:00 +0000 (22:32 +1000)]
Changes to missinggo resource package

8 years agoRename some storage funcs
Matt Joiner [Mon, 16 May 2016 12:02:03 +0000 (22:02 +1000)]
Rename some storage funcs

8 years agoRename storage.I->Client
Matt Joiner [Mon, 16 May 2016 11:50:43 +0000 (21:50 +1000)]
Rename storage.I->Client

8 years agoTest both resource and file backends to piece storage
Matt Joiner [Mon, 16 May 2016 10:11:00 +0000 (20:11 +1000)]
Test both resource and file backends to piece storage

8 years agoRemove unused fields in testDownloadCancelParams
Matt Joiner [Mon, 16 May 2016 10:10:33 +0000 (20:10 +1000)]
Remove unused fields in testDownloadCancelParams

8 years agoDon't log missing files during hashing
Matt Joiner [Mon, 16 May 2016 09:50:46 +0000 (19:50 +1000)]
Don't log missing files during hashing

8 years agoStop returning errors from the 2 callstacks to connectionLoop where errors are expected
Matt Joiner [Mon, 16 May 2016 09:50:10 +0000 (19:50 +1000)]
Stop returning errors from the 2 callstacks to connectionLoop where errors are expected

8 years agoReturn an error from Torrent.setMetadataSize
Matt Joiner [Mon, 16 May 2016 08:48:56 +0000 (18:48 +1000)]
Return an error from Torrent.setMetadataSize

This should mean connections sending ridiculous metadata sizes get dropped.

8 years agoMove requestPendingMetadata onto connection from Client
Matt Joiner [Mon, 16 May 2016 08:46:38 +0000 (18:46 +1000)]
Move requestPendingMetadata onto connection from Client

8 years agoiplist/cmd/pack-blocklist use tagflag
Matt Joiner [Mon, 16 May 2016 08:45:23 +0000 (18:45 +1000)]
iplist/cmd/pack-blocklist use tagflag

8 years agoAdd piece-per-resource storage
Matt Joiner [Mon, 16 May 2016 08:44:58 +0000 (18:44 +1000)]
Add piece-per-resource storage

8 years agoProbably fix test failure
Matt Joiner [Thu, 12 May 2016 02:44:51 +0000 (12:44 +1000)]
Probably fix test failure

Due to some changes in the Torrent instantiation code, I think there's a race in this test to verify the piece before counting the pending chunks. The torrent isn't supposed to be complete to begin with, so give it a bogus data directory to ensure it.

8 years agoBit of a tidy in the tracker code
Matt Joiner [Thu, 12 May 2016 02:43:37 +0000 (12:43 +1000)]
Bit of a tidy in the tracker code

8 years agoTorrent.AddPeers can't fail, so don't return an error
Matt Joiner [Thu, 12 May 2016 02:26:09 +0000 (12:26 +1000)]
Torrent.AddPeers can't fail, so don't return an error

8 years agoFix race marshalling a bitfield after a Have has also been posted
Matt Joiner [Wed, 11 May 2016 13:50:21 +0000 (23:50 +1000)]
Fix race marshalling a bitfield after a Have has also been posted

8 years agoUpdate package doc
Matt Joiner [Wed, 11 May 2016 11:53:42 +0000 (21:53 +1000)]
Update package doc

In particular, ConfigDir has gone away.

8 years agoGet rid of obsoleted Torrent.ceaseNetworking, and clean up Torrent.closing
Matt Joiner [Wed, 11 May 2016 11:44:55 +0000 (21:44 +1000)]
Get rid of obsoleted Torrent.ceaseNetworking, and clean up Torrent.closing

8 years agoRework Client listeners
Matt Joiner [Wed, 11 May 2016 11:11:52 +0000 (21:11 +1000)]
Rework Client listeners

In particular, if the ListenAddr used a dynamic port ":0", and both TCP and uTP were enabled. If the TCP listen succeeded, and the uTP did not, the TCP listener was leaked, and another port number was not tried.

8 years agoRemove unused Client.pruneTimer
Matt Joiner [Wed, 11 May 2016 11:08:55 +0000 (21:08 +1000)]
Remove unused Client.pruneTimer

8 years agoWasn't using ChunkSize from TorrentSpec
Matt Joiner [Mon, 9 May 2016 13:00:20 +0000 (23:00 +1000)]
Wasn't using ChunkSize from TorrentSpec

8 years agoLock now required around missinggo.Event variables
Matt Joiner [Mon, 9 May 2016 06:44:06 +0000 (16:44 +1000)]
Lock now required around missinggo.Event variables

8 years agoRework setting of info bytes
Matt Joiner [Mon, 9 May 2016 05:47:39 +0000 (15:47 +1000)]
Rework setting of info bytes

8 years agoAdd some comments to file storage
Matt Joiner [Mon, 9 May 2016 05:46:48 +0000 (15:46 +1000)]
Add some comments to file storage

8 years agoAdd Client.AddTorrentInfoHash, and some other tidying
Matt Joiner [Mon, 9 May 2016 04:37:29 +0000 (14:37 +1000)]
Add Client.AddTorrentInfoHash, and some other tidying

Remove Client.bannedTorrents, which shouldn't have been in use anymore. Also fix Client.newTorrent.

8 years agoRemove the vestiges of the expose tracker Client interface
Matt Joiner [Mon, 9 May 2016 02:20:35 +0000 (12:20 +1000)]
Remove the vestiges of the expose tracker Client interface

8 years agodht: Fix race contacting starting addrs in Announce
Matt Joiner [Sat, 7 May 2016 09:02:30 +0000 (19:02 +1000)]
dht: Fix race contacting starting addrs in Announce

8 years agoFix dht.Server.Announce never stopping if the starting addresses can't be contacted
Matt Joiner [Sat, 7 May 2016 08:58:43 +0000 (18:58 +1000)]
Fix dht.Server.Announce never stopping if the starting addresses can't be contacted

8 years agoMove some behaviour into Client.newConnection
Matt Joiner [Sat, 7 May 2016 08:57:38 +0000 (18:57 +1000)]
Move some behaviour into Client.newConnection

8 years agomissinggo.Event changed, connection.writeOptimizer changes
Matt Joiner [Sat, 7 May 2016 08:56:44 +0000 (18:56 +1000)]
missinggo.Event changed, connection.writeOptimizer changes

8 years agotracker: Skip DNS error in UDP test
Matt Joiner [Sat, 7 May 2016 08:17:40 +0000 (18:17 +1000)]
tracker: Skip DNS error in UDP test

8 years agocmd/torrent-infohash update for API changes
Matt Joiner [Fri, 6 May 2016 05:09:59 +0000 (15:09 +1000)]
cmd/torrent-infohash update for API changes

8 years agoRemove the last of the "config dir" stuff
Matt Joiner [Thu, 5 May 2016 13:05:28 +0000 (23:05 +1000)]
Remove the last of the "config dir" stuff

This just conflates the Client. It should be done orthogonally.

8 years agometainfo.InfoEx.Hash becomes a function, UpdateBytes is added, and Bytes used in...
Matt Joiner [Thu, 5 May 2016 12:40:38 +0000 (22:40 +1000)]
metainfo.InfoEx.Hash becomes a function, UpdateBytes is added, and Bytes used in marshalling

Fixes #80.

8 years agometainfo: Add HashBytes
Matt Joiner [Tue, 3 May 2016 11:34:20 +0000 (21:34 +1000)]
metainfo: Add HashBytes

8 years agometainfo: Improve doc
Matt Joiner [Tue, 3 May 2016 11:34:11 +0000 (21:34 +1000)]
metainfo: Improve doc

8 years agometainfo.Info.BuildFromFilePath contained unnecessary log, and didn't handle error...
Matt Joiner [Tue, 3 May 2016 10:25:16 +0000 (20:25 +1000)]
metainfo.Info.BuildFromFilePath contained unnecessary log, and didn't handle error correctly

8 years agocmd/torrent-create: Tidy up flags and remove redundant function calls
Matt Joiner [Tue, 3 May 2016 06:49:30 +0000 (16:49 +1000)]
cmd/torrent-create: Tidy up flags and remove redundant function calls

Issue #80

8 years agoMove a bunch of Torrent methods from client.go
Matt Joiner [Tue, 3 May 2016 06:47:11 +0000 (16:47 +1000)]
Move a bunch of Torrent methods from client.go

8 years agoRework handling of metadata data messages
Matt Joiner [Tue, 3 May 2016 04:59:54 +0000 (14:59 +1000)]
Rework handling of metadata data messages

There are some dubious logs probably resulting from poor ordering of some code for handling incoming metadata data messages.

8 years agoDoc and logging improvements
Matt Joiner [Tue, 3 May 2016 04:58:26 +0000 (14:58 +1000)]
Doc and logging improvements

8 years agocmd/torrent-metainfo-pprint: Add -files flag, and expose NumFiles and TotalLength...
Matt Joiner [Tue, 3 May 2016 02:51:31 +0000 (12:51 +1000)]
cmd/torrent-metainfo-pprint: Add -files flag, and expose NumFiles and TotalLength in output

8 years agoDoc metainfo.Info.BuildFromFilePath
Matt Joiner [Tue, 3 May 2016 02:51:03 +0000 (12:51 +1000)]
Doc metainfo.Info.BuildFromFilePath

8 years agocmd/torrent-metainfo-pprint: Also print InfoHash
Matt Joiner [Mon, 2 May 2016 09:14:49 +0000 (19:14 +1000)]
cmd/torrent-metainfo-pprint: Also print InfoHash

8 years agoAdd metainfo.Hash.FromHexString
Matt Joiner [Mon, 2 May 2016 01:21:03 +0000 (11:21 +1000)]
Add metainfo.Hash.FromHexString

8 years agoRemove metainfo.Builder, and issue #35 test for it
Matt Joiner [Sat, 30 Apr 2016 02:00:12 +0000 (12:00 +1000)]
Remove metainfo.Builder, and issue #35 test for it

Builder is poorly designed, and issue #35 is poorly written. I don't want to support either of them.

8 years agoAllow encoding private=0 in metainfo, which fixes test for not using InfoEx.Bytes...
Matt Joiner [Sat, 30 Apr 2016 01:59:10 +0000 (11:59 +1000)]
Allow encoding private=0 in metainfo, which fixes test for not using InfoEx.Bytes when marshalling as a shortcut

8 years agoAlso fix "context" in reader_test.go
Matt Joiner [Sat, 30 Apr 2016 01:46:45 +0000 (11:46 +1000)]
Also fix "context" in reader_test.go

8 years agoUgh, "context" isn't in go 1.6
Matt Joiner [Sat, 30 Apr 2016 01:33:07 +0000 (11:33 +1000)]
Ugh, "context" isn't in go 1.6

8 years agoAdd Reader.ReadContext
Matt Joiner [Sat, 30 Apr 2016 01:08:29 +0000 (11:08 +1000)]
Add Reader.ReadContext

Allows cancelling reads etc. Torrents that get stuck can result in Reads that won't return until the torrent is dropped.

8 years agoSome changes to metainfo.InfoEx and testutil
Matt Joiner [Sat, 30 Apr 2016 01:07:29 +0000 (11:07 +1000)]
Some changes to metainfo.InfoEx and testutil

8 years agoFix crash when peers have sent undersized bitfields and we get the torrent info
Matt Joiner [Fri, 29 Apr 2016 18:08:02 +0000 (04:08 +1000)]
Fix crash when peers have sent undersized bitfields and we get the torrent info

8 years agoChange the behaviour of Torrent.Length with when info isn't available
Matt Joiner [Wed, 20 Apr 2016 10:10:39 +0000 (20:10 +1000)]
Change the behaviour of Torrent.Length with when info isn't available

8 years agoImprove some docs
Matt Joiner [Wed, 20 Apr 2016 10:10:10 +0000 (20:10 +1000)]
Improve some docs

8 years agoFix receiver pointeriness for some File methods
Matt Joiner [Tue, 19 Apr 2016 07:20:31 +0000 (17:20 +1000)]
Fix receiver pointeriness for some File methods

8 years agocmd/torrent: Add -addr flag back in
Matt Joiner [Tue, 19 Apr 2016 07:20:14 +0000 (17:20 +1000)]
cmd/torrent: Add -addr flag back in

8 years agoMerge pull request #79 from shoenig/normalize
Matt Joiner [Tue, 19 Apr 2016 07:10:42 +0000 (17:10 +1000)]
Merge pull request #79 from shoenig/normalize

refactor struct identifiers to follow conventional go names