]> Sergey Matveev's repositories - btrtrc.git/log
btrtrc.git
5 weeks agocmd/btrtrc client btrtrc
Sergey Matveev [Thu, 20 Apr 2023 07:42:38 +0000 (10:42 +0300)]
cmd/btrtrc client

5 weeks agoLower log level for peer upload read errors when Torrent is closed
Matt Joiner [Tue, 6 May 2025 02:17:36 +0000 (12:17 +1000)]
Lower log level for peer upload read errors when Torrent is closed

Fixes #980.

6 weeks agoRefactor Reader.readOnceAt
Matt Joiner [Mon, 28 Apr 2025 01:36:11 +0000 (11:36 +1000)]
Refactor Reader.readOnceAt

Looks like there was some errors that could be dropped.
We also handle a few corner cases and ReadAt returning 0 being handled non-canonically.

6 weeks agoUpdate requests when piece order changes if there's a storage cap
Matt Joiner [Mon, 28 Apr 2025 01:05:44 +0000 (11:05 +1000)]
Update requests when piece order changes if there's a storage cap

6 weeks agoStorage cap wasn't passed to piece resource implementation
Matt Joiner [Mon, 28 Apr 2025 00:42:00 +0000 (10:42 +1000)]
Storage cap wasn't passed to piece resource implementation

This breaks the tests, because it was actually masking bad behaviour.

6 weeks agoExpose PieceRequestOrder.Iter and PieceRequestOrderItem for debugging
Matt Joiner [Mon, 28 Apr 2025 00:33:59 +0000 (10:33 +1000)]
Expose PieceRequestOrder.Iter and PieceRequestOrderItem for debugging

6 weeks agoSwitch to github.com/anacrolix/fuse@v0.4.0
Matt Joiner [Mon, 28 Apr 2025 00:28:38 +0000 (10:28 +1000)]
Switch to github.com/anacrolix/fuse@v0.4.0

I'm sick of osxfuse asking about kext on macOS

6 weeks agoAdd Reader.SetContext to deprecated ReadContext
Matt Joiner [Mon, 28 Apr 2025 00:27:17 +0000 (10:27 +1000)]
Add Reader.SetContext to deprecated ReadContext

6 weeks agoComments and tidies
Matt Joiner [Mon, 28 Apr 2025 00:15:18 +0000 (10:15 +1000)]
Comments and tidies

7 weeks agoUse iters in a few places around segments and v2 file trees and ensure mmap storage...
Matt Joiner [Fri, 25 Apr 2025 05:04:47 +0000 (15:04 +1000)]
Use iters in a few places around segments and v2 file trees and ensure mmap storage has v2 compatible segment index

7 weeks agoReturn errors in mmap storage piece completion
Matt Joiner [Fri, 25 Apr 2025 01:46:07 +0000 (11:46 +1000)]
Return errors in mmap storage piece completion

7 weeks agogorond
Matt Joiner [Thu, 24 Apr 2025 13:08:59 +0000 (23:08 +1000)]
gorond

7 weeks agoAdd a few TODOs and fixes to trackerScraper
Matt Joiner [Thu, 24 Apr 2025 13:07:52 +0000 (23:07 +1000)]
Add a few TODOs and fixes to trackerScraper

7 weeks agoSet rate limiter bursts automatically if limit is not Inf
Matt Joiner [Thu, 24 Apr 2025 13:06:50 +0000 (23:06 +1000)]
Set rate limiter bursts automatically if limit is not Inf

7 weeks agoInclude torrent info hash as logger context text
Matt Joiner [Thu, 24 Apr 2025 13:06:15 +0000 (23:06 +1000)]
Include torrent info hash as logger context text

7 weeks agoAdd Request.String
Matt Joiner [Thu, 24 Apr 2025 13:05:42 +0000 (23:05 +1000)]
Add Request.String

7 weeks agoMake WebSeed max requests configurable
Matt Joiner [Thu, 24 Apr 2025 13:05:32 +0000 (23:05 +1000)]
Make WebSeed max requests configurable

7 weeks agoChange ClientConfig.MaxAllocPeerRequestDataPerConn to be an int
Matt Joiner [Thu, 24 Apr 2025 13:04:33 +0000 (23:04 +1000)]
Change ClientConfig.MaxAllocPeerRequestDataPerConn to be an int

7 weeks agoInclude incomplete torrent count in client status
Matt Joiner [Thu, 24 Apr 2025 13:03:50 +0000 (23:03 +1000)]
Include incomplete torrent count in client status

7 weeks agoFix dumpStats to reuse spew config
Matt Joiner [Thu, 24 Apr 2025 13:03:12 +0000 (23:03 +1000)]
Fix dumpStats to reuse spew config

7 weeks agoStrongly type client piece request order keys
Matt Joiner [Thu, 24 Apr 2025 13:08:38 +0000 (23:08 +1000)]
Strongly type client piece request order keys

8 weeks agoAdd new metrics and PeerStats
Matt Joiner [Thu, 17 Apr 2025 00:34:42 +0000 (10:34 +1000)]
Add new metrics and PeerStats

2 months agoAdd BytesHashed count and refactor for other Torrent-level counts
Matt Joiner [Wed, 9 Apr 2025 06:21:06 +0000 (16:21 +1000)]
Add BytesHashed count and refactor for other Torrent-level counts

2 months agocmd/torrent: Add verify and flag for large chunk uploads
Matt Joiner [Wed, 9 Apr 2025 09:45:53 +0000 (19:45 +1000)]
cmd/torrent: Add verify and flag for large chunk uploads

Fix nil deref if flag isn't provided

2 months agoAdd Torrent.VerifyDataContext
Matt Joiner [Wed, 9 Apr 2025 05:05:26 +0000 (15:05 +1000)]
Add Torrent.VerifyDataContext

2 months agoAdd infohash to torrent logger
Matt Joiner [Wed, 9 Apr 2025 05:03:36 +0000 (15:03 +1000)]
Add infohash to torrent logger

2 months agocmd/torrent: Switch to a status output more suited for lots of torrents
Matt Joiner [Wed, 9 Apr 2025 05:03:06 +0000 (15:03 +1000)]
cmd/torrent: Switch to a status output more suited for lots of torrents

2 months agoFix races in client tracker status event callback tests
Matt Joiner [Wed, 9 Apr 2025 02:40:53 +0000 (12:40 +1000)]
Fix races in client tracker status event callback tests

2 months agoAdd Piece.VerifyDataContext and improve piece VerifyData concurrency
Matt Joiner [Wed, 9 Apr 2025 02:27:19 +0000 (12:27 +1000)]
Add Piece.VerifyDataContext and improve piece VerifyData concurrency

2 months agogorond
Matt Joiner [Wed, 9 Apr 2025 02:25:34 +0000 (12:25 +1000)]
gorond

2 months agoSwitch client_test.go to go-quicktest/qt and add errTorrentClosed
Matt Joiner [Wed, 9 Apr 2025 02:24:45 +0000 (12:24 +1000)]
Switch client_test.go to go-quicktest/qt and add errTorrentClosed

2 months agocmd/torrent: Remove redundant signal notification
Matt Joiner [Wed, 9 Apr 2025 00:03:44 +0000 (10:03 +1000)]
cmd/torrent: Remove redundant signal notification

2 months agoPull possum fix for Go 1.24
Matt Joiner [Mon, 7 Apr 2025 03:02:09 +0000 (13:02 +1000)]
Pull possum fix for Go 1.24

2 months agocmd/torrent: Some log, ctx and error handling cleanup
Matt Joiner [Fri, 4 Apr 2025 05:21:23 +0000 (16:21 +1100)]
cmd/torrent: Some log, ctx and error handling cleanup

2 months agoExpose torrent Peer status updates (#987)
Marco Vidonis [Tue, 18 Mar 2025 23:29:32 +0000 (23:29 +0000)]
Expose torrent Peer status updates (#987)

* handle connection to torrent peer status update messages

* basic observer framework
* connects to a valid tracker
* added observer channel for announce status
* set up Peer Connection status Observers
* add PeerConn test: connection established
* added Observers factory method
* Added Event to AnnounceStatus, with embedded TrackerStatus
* state updates must be non-blocking
* add unit tests on PeerConn Observer status reading
* add test and debug log on dropped connection
* add PeerID check to test

---------

Co-authored-by: Parker Whittle <pwhittle@medicom.us>
* do not support webtorrent/transport_test on wasm

* make AnnounceStatus InfoHash into a HexString

* replace MakeMapIfNilAndSet

* add StatusUpdated to callbacks

* replace Observers on Peer Conn status with callbacks

* replace tracker status updates with callbacks

* replace tracker announce status updates with callbacks

* remove references to observers

* test callbacks in client-peerconn_test

* add check that all callbacks were called in peer connection test

* test callbacks in client-tracker_test

---------

Co-authored-by: Parker Whittle <pwhittle@medicom.us>
2 months agoupdates to actions/cache v3 (#1000)
Phil Cummins [Sun, 16 Mar 2025 11:34:53 +0000 (12:34 +0100)]
updates to actions/cache v3 (#1000)

Co-authored-by: Phil Cummins <philip.cummins@bsc.es>
3 months agoFix building go-libutp with C17 v1.58.1
Matt Joiner [Sun, 16 Feb 2025 01:22:40 +0000 (12:22 +1100)]
Fix building go-libutp with C17

Fixes #995

5 months agoWebSeed seems supported (#993)
Mitar [Sat, 28 Dec 2024 23:55:04 +0000 (00:55 +0100)]
WebSeed seems supported (#993)

7 months agoIgnore /.env v1.58.0
Matt Joiner [Thu, 17 Oct 2024 23:55:16 +0000 (10:55 +1100)]
Ignore /.env

I use this to set up CGO_LDFLAGS for possum

7 months agoAdd just check
Matt Joiner [Thu, 17 Oct 2024 23:54:02 +0000 (10:54 +1100)]
Add just check

7 months agoOnly apply WebRTC data channel write limit to webtorrent peer conns
Matt Joiner [Thu, 17 Oct 2024 23:57:59 +0000 (10:57 +1100)]
Only apply WebRTC data channel write limit to webtorrent peer conns

8 months agoupgrade pion/webrtc to v4 (#985)
Marco Vidonis [Mon, 14 Oct 2024 10:04:15 +0000 (11:04 +0100)]
upgrade pion/webrtc to v4 (#985)

8 months agoUpdate dep to remove govulncheck finding
Matt Joiner [Mon, 7 Oct 2024 00:30:33 +0000 (11:30 +1100)]
Update dep to remove govulncheck finding

8 months agoExpose WebRTC peerconn stats (#983)
Marco Vidonis [Thu, 3 Oct 2024 14:46:35 +0000 (15:46 +0100)]
Expose WebRTC peerconn stats (#983)

* add WebRTC peer connection transport stats

* save all peer connections in tracker-client and make stats available when seeding

* make offer ID keys into readable strings

* handle unsupported Peer Conn stats on WASM

8 months agoUsed aider and claude to refactor storage tests to go-quicktest/qt
Matt Joiner (aider) [Wed, 2 Oct 2024 01:25:32 +0000 (11:25 +1000)]
Used aider and claude to refactor storage tests to go-quicktest/qt

https://github.com/anacrolix/torrent/issues/959

8 months agoSet ConnectionIdMismatchNul error default log level to debug
Matt Joiner [Mon, 30 Sep 2024 02:13:59 +0000 (12:13 +1000)]
Set ConnectionIdMismatchNul error default log level to debug

8 months agoUse stdlib replacements of golang.org/x/exp and newer multiless
Matt Joiner [Sun, 29 Sep 2024 03:54:25 +0000 (13:54 +1000)]
Use stdlib replacements of golang.org/x/exp and newer multiless

Fixes #957.

8 months agogorond v1.57.1
Matt Joiner [Sat, 28 Sep 2024 12:20:25 +0000 (22:20 +1000)]
gorond

8 months agoRework handshake parsing
Matt Joiner [Sat, 28 Sep 2024 12:19:29 +0000 (22:19 +1000)]
Rework handshake parsing

8 months agoRemove use of missinggo perf
Matt Joiner [Sat, 28 Sep 2024 12:02:16 +0000 (22:02 +1000)]
Remove use of missinggo perf

9 months agoFix panic using web RTC RemoteAddr directly from conn v1.57.0
Matt Joiner [Mon, 9 Sep 2024 10:53:29 +0000 (20:53 +1000)]
Fix panic using web RTC RemoteAddr directly from conn

Fixes #972.

9 months agotracker/udp: Reset connection ID on error response
Matt Joiner [Tue, 3 Sep 2024 05:18:54 +0000 (15:18 +1000)]
tracker/udp: Reset connection ID on error response

9 months agotracker/udp: Improve context handling
Matt Joiner [Tue, 3 Sep 2024 05:18:30 +0000 (15:18 +1000)]
tracker/udp: Improve context handling

9 months agoBasic support for responding to HashRequest
mivik [Thu, 29 Aug 2024 09:13:44 +0000 (17:13 +0800)]
Basic support for responding to HashRequest

Also Piece.hasPieceLayer seems to be faulty so I tried fixing it

9 months agoSupport encoding Hashes & HashReject messages
mivik [Thu, 29 Aug 2024 09:12:44 +0000 (17:12 +0800)]
Support encoding Hashes & HashReject messages

9 months agoAdd webseed name to webseed peer logger
Matt Joiner [Tue, 27 Aug 2024 02:03:09 +0000 (12:03 +1000)]
Add webseed name to webseed peer logger

9 months agoFix webseed stall on request errors
Matt Joiner [Tue, 27 Aug 2024 02:03:01 +0000 (12:03 +1000)]
Fix webseed stall on request errors

9 months agoFix errors in webseed causing very long stalls in requesting
Matt Joiner [Tue, 27 Aug 2024 01:32:38 +0000 (11:32 +1000)]
Fix errors in webseed causing very long stalls in requesting

Reuse the "too fast" error handling for all errors when requesting from webseeds. This prevents long stalls due to common errors.

9 months agoFix webseeds not requesting after priorities are already set
Matt Joiner [Tue, 27 Aug 2024 01:29:59 +0000 (11:29 +1000)]
Fix webseeds not requesting after priorities are already set

https://github.com/anacrolix/torrent/issues/964#issuecomment-2295308596

9 months agoAdd test showing add webseed doesn't request after priorities are already set
Matt Joiner [Tue, 27 Aug 2024 01:29:18 +0000 (11:29 +1000)]
Add test showing add webseed doesn't request after priorities are already set

9 months agoFix empty Info marshalling test
Matt Joiner [Tue, 27 Aug 2024 00:03:22 +0000 (10:03 +1000)]
Fix empty Info marshalling test

9 months agoBasic support for serializing v2 torrent file (#968)
Mivik [Mon, 26 Aug 2024 09:44:45 +0000 (17:44 +0800)]
Basic support for serializing v2 torrent file (#968)

* Support marshalling FileTree

* Omit Pieces in torrent info if empty

Otherwise some BitTorrent client (e.g. libttorrent) will not be able to
parse v2 torrent file.

10 months agoTidy up cmd/torrent cleanup and websocket trackers logging
Matt Joiner [Tue, 13 Aug 2024 01:09:34 +0000 (11:09 +1000)]
Tidy up cmd/torrent cleanup and websocket trackers logging

10 months agoAdd contexted ReadWriter to handshakes
Matt Joiner [Sat, 10 Aug 2024 11:51:45 +0000 (21:51 +1000)]
Add contexted ReadWriter to handshakes

10 months agoAdd context to mse handshakes
Matt Joiner [Sat, 10 Aug 2024 04:41:02 +0000 (14:41 +1000)]
Add context to mse handshakes

10 months agoFix spello
Matt Joiner [Wed, 24 Jul 2024 05:21:02 +0000 (15:21 +1000)]
Fix spello

10 months agoChange some metainfo.MetaInfo methods to take pointer receivers
Matt Joiner [Tue, 23 Jul 2024 08:58:59 +0000 (18:58 +1000)]
Change some metainfo.MetaInfo methods to take pointer receivers

It's kind of unnecessary to take them by value here, and, slower. Use Rust instead!!

10 months agoBe more pedantic about trailing data in metainfo.Load and bencode.Unmarshal
Matt Joiner [Tue, 23 Jul 2024 08:58:04 +0000 (18:58 +1000)]
Be more pedantic about trailing data in metainfo.Load and bencode.Unmarshal

Fixes https://github.com/anacrolix/torrent/issues/963.

10 months agoTidy up use of quicktest
Matt Joiner [Tue, 23 Jul 2024 08:53:10 +0000 (18:53 +1000)]
Tidy up use of quicktest

11 months agoRemove confusing symlink
Matt Joiner [Sat, 13 Jul 2024 11:37:57 +0000 (21:37 +1000)]
Remove confusing symlink

Related to issue #961

11 months agoFix bad recursive reads in piece resource chunks ReadAt
Matt Joiner [Fri, 12 Jul 2024 05:21:37 +0000 (15:21 +1000)]
Fix bad recursive reads in piece resource chunks ReadAt

It would always read from the first chunk, and scan across io.EOF until it hit the right chunk.

11 months agoFix shadowed error in webseed response handling
Matt Joiner [Sun, 30 Jun 2024 09:52:53 +0000 (19:52 +1000)]
Fix shadowed error in webseed response handling

11 months agoUse mmap storage in test for performance
Matt Joiner [Thu, 27 Jun 2024 05:49:13 +0000 (15:49 +1000)]
Use mmap storage in test for performance

11 months agoResolve log and chansync from workspace
Matt Joiner [Thu, 27 Jun 2024 04:52:59 +0000 (14:52 +1000)]
Resolve log and chansync from workspace

11 months agogorond
Matt Joiner [Thu, 27 Jun 2024 04:35:46 +0000 (14:35 +1000)]
gorond

11 months agoAdd peer bootstrapping integration test
Matt Joiner [Thu, 27 Jun 2024 04:33:18 +0000 (14:33 +1000)]
Add peer bootstrapping integration test

11 months agoMake Torrent.Complete a method and make it return a read-only interface
Matt Joiner [Thu, 27 Jun 2024 04:32:32 +0000 (14:32 +1000)]
Make Torrent.Complete a method and make it return a read-only interface

11 months agoFix sqlite piece completion error when dirs are missing
Matt Joiner [Thu, 27 Jun 2024 04:31:31 +0000 (14:31 +1000)]
Fix sqlite piece completion error when dirs are missing

11 months agoAdd a Context param to ClientImpl.OpenTorrent for logging
Matt Joiner [Thu, 27 Jun 2024 04:34:54 +0000 (14:34 +1000)]
Add a Context param to ClientImpl.OpenTorrent for logging

This is very likely going to be a breaking change, but the alternative is a nightmare of backwards compatibility.

11 months agobencode: Support unmarshalling into maps with non-string key types
Matt Joiner [Wed, 26 Jun 2024 13:30:08 +0000 (23:30 +1000)]
bencode: Support unmarshalling into maps with non-string key types

Fixes #952

11 months agoRearrange the workspaces in tests
Matt Joiner [Wed, 26 Jun 2024 13:37:24 +0000 (23:37 +1000)]
Rearrange the workspaces in tests

11 months agoImprove some pointer stuff around worseConnInput
Matt Joiner [Wed, 26 Jun 2024 10:43:46 +0000 (20:43 +1000)]
Improve some pointer stuff around worseConnInput

12 months agoCorrectly hash hybrid torrents with trailing v1 padding file v1.56.1
Matt Joiner [Tue, 11 Jun 2024 06:21:04 +0000 (16:21 +1000)]
Correctly hash hybrid torrents with trailing v1 padding file

Fixes #949.

12 months agoUpdate possum dep v1.56.0
Matt Joiner [Mon, 3 Jun 2024 03:43:31 +0000 (13:43 +1000)]
Update possum dep

12 months agopossum: Use MovePrefix for completed chunks
Matt Joiner [Sat, 9 Mar 2024 06:36:22 +0000 (17:36 +1100)]
possum: Use MovePrefix for completed chunks

12 months agoclone func used since go 1.21 (#947)
ucwong [Thu, 30 May 2024 23:16:37 +0000 (00:16 +0100)]
clone func used since go 1.21 (#947)

12 months agoadd Torrent.ModifyTrackers() func (#945)
ucwong [Sun, 26 May 2024 11:47:04 +0000 (12:47 +0100)]
add Torrent.ModifyTrackers() func (#945)

* add ClearTrackers() func

* add stop channel for each announcer

* add stop once avoid multi close

* use waitgroup to stop ann

12 months agofix: upnp clear loop trap (#946)
Levi [Sun, 26 May 2024 11:38:54 +0000 (19:38 +0800)]
fix: upnp clear loop trap (#946)

12 months ago--- (#941)
dependabot[bot] [Fri, 24 May 2024 03:30:20 +0000 (13:30 +1000)]
--- (#941)

updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
12 months agofix: clear UPNP port mappings when client close (#942)
Levi [Fri, 24 May 2024 03:29:40 +0000 (11:29 +0800)]
fix: clear UPNP port mappings when client close (#942)

* fix: clear UPNP port mappings when client close

* fix: go mod sum

13 months agoAdd type updateRequestReason and comments
Matt Joiner [Fri, 3 May 2024 03:46:35 +0000 (13:46 +1000)]
Add type updateRequestReason and comments

13 months agoAdded comments and variables instead of raw reason strings
Mark Holt [Mon, 29 Apr 2024 21:05:49 +0000 (22:05 +0100)]
Added comments and variables instead of raw reason strings

13 months agoAdd Toru to downstream projects
Matt Joiner [Fri, 3 May 2024 03:30:37 +0000 (13:30 +1000)]
Add Toru to downstream projects

13 months agosteal stability
Mark Holt [Sat, 20 Apr 2024 07:17:09 +0000 (08:17 +0100)]
steal stability

13 months agofile.Flush() (#937)
Alex Sharov [Fri, 26 Apr 2024 06:51:39 +0000 (13:51 +0700)]
file.Flush() (#937)

13 months agoMerge pull request #936 from anacrolix/ci_up
Alex Sharov [Thu, 25 Apr 2024 07:23:58 +0000 (14:23 +0700)]
Merge pull request #936 from anacrolix/ci_up

CI: upgrade `actions/checkout`

13 months agoMerge pull request #935 from anacrolix/dependabot/go_modules/tests/issue-930/golang...
Alex Sharov [Thu, 25 Apr 2024 06:03:20 +0000 (13:03 +0700)]
Merge pull request #935 from anacrolix/dependabot/go_modules/tests/issue-930/golang.org/x/net-0.23.0

Bump golang.org/x/net from 0.10.0 to 0.23.0 in /tests/issue-930

13 months agosave
alex.sharov [Thu, 25 Apr 2024 05:56:29 +0000 (12:56 +0700)]
save

13 months agoOptimize memory usage by avoiding intermediate buffer in message serialization (...
Luo Zhengjie [Thu, 25 Apr 2024 05:19:54 +0000 (13:19 +0800)]
Optimize memory usage by avoiding intermediate buffer in message serialization (#928)

* Optimize memory usage by avoiding intermediate buffer in message serialization

This commit replaces the use of an intermediate buffer in the message serialization process with a direct write-to-buffer approach. The original implementation used MustMarshalBinary() which involved an extra memory copy to an intermediate buffer before writing to the final writeBuffer, leading to high memory consumption for large messages. The new WriteTo function writes message data directly to the writeBuffer, significantly reducing memory overhead and CPU time spent on garbage collection.

* add benchmark for write

* benchmark for 1M/4M/8M

* Tidy up new benchmarks

* Maintain older payload write implementation

---------

Co-authored-by: luozhengjie.lzj <luozhengjie.lzj@alibaba-inc.com>
Co-authored-by: Matt Joiner <anacrolix@gmail.com>
13 months agoPull zig cross compile fixes for go-llsqlite/crawshaw
Matt Joiner [Thu, 25 Apr 2024 03:54:37 +0000 (13:54 +1000)]
Pull zig cross compile fixes for go-llsqlite/crawshaw