2
0
mirror of synced 2025-02-23 22:28:11 +00:00

3521 Commits

Author SHA1 Message Date
Matt Joiner
abb5cbc96e
Check for chunks overflowing piece bounds on request read
Test for integer overflow in when checking read requests are within the bounds of the associated piece. Another fix is required to limit the amount of memory that can be allocated for such requests.
2023-02-13 23:27:15 +11:00
Colin Marc
60fd7581e7
Remove unecessary completion "set" (#812)
If the file has never been downloaded, complete will naturally be false. It's
not necessary to then set it false again unless it was actually claimed to be
true in the first place.

In my tests, using the boltdb completion thingy with fsync turned *on*, this
reduced the cold start for big buck bunny from multiple seconds to just a few
ms.
2023-02-13 14:26:03 +11:00
Spencer Comfort
5a185c45c0
Update codeql analysis to v2 (#806)
Updates the outdated codeql analysis actions to v2
2023-01-31 08:41:06 +11:00
Matt Joiner
d47739db0c
Roaring bitmap tests now pass when run from downstream 2023-01-24 08:52:49 +11:00
Matt Joiner
8fe9fb78aa
Add span for udp packet handling 2023-01-08 17:22:02 +11:00
Matt Joiner
1eb923c947
Forward leechers and seeders announce handler results 2023-01-05 00:05:34 +11:00
Matt Joiner
2dfb57f3f7
Handle left param for http tracker server announces 2023-01-05 00:04:42 +11:00
Matt Joiner
c20f73d53e
gorond 2023-01-04 01:26:31 +11:00
Matt Joiner
a512c0df61
Add a check that piece request order items are scanned in order
It's not clear from btree documentation that scan should be ordered.
2023-01-04 01:25:57 +11:00
Matt Joiner
8e0e36887f
Fix an issue parsing negative bencode string lengths
See the fuzz test in dht/krpc.
2023-01-04 01:25:26 +11:00
Matt Joiner
6baf8dcb99
Limit udp tracker server request concurrency 2023-01-03 00:14:21 +11:00
Matt Joiner
8c267645bf
Update tidwall/btree 2022-12-31 13:25:00 +11:00
Matt Joiner
14cf045b6a
Sleep webseed peers after unhandled errors 2022-12-31 11:27:47 +11:00
Matt Joiner
f38629d354
Assume upstream peers are leechers 2022-12-29 19:42:19 +11:00
Matt Joiner
4f8826483e
Resize packet buffer to avoid wasting memory 2022-12-29 19:41:36 +11:00
Matt Joiner
f61085c785
Avoid panic in AnnounceEvent.String 2022-12-29 19:41:09 +11:00
Matt Joiner
5f127343b0
Fix race when final peers are available early 2022-12-29 19:40:20 +11:00
Matt Joiner
7d3d4bc088
Add Context parameter to SendResponse 2022-12-29 10:22:03 +11:00
Matt Joiner
7f3655a14b
Track request payload len 2022-12-29 10:21:34 +11:00
Matt Joiner
61a303cbf7
Default to announcing as leecher
(cherry picked from commit 16da3c0c46a71d6f270600c63acb674226c1c9ae)
2022-12-25 19:57:16 +11:00
Matt Joiner
e235776204
Add --port flag to announce
(cherry picked from commit e554aa19a691615f349bf6dae0601706ea47dc03)
2022-12-25 19:56:55 +11:00
Matt Joiner
87105005e3
Merge branch 'universal-webseed-escaping' 2022-12-25 19:26:01 +11:00
Matt Joiner
fed765b2a0
Fix write error handling
Fixes https://github.com/anacrolix/torrent/issues/798.

Prior to this fix, it looks like the writer would just keep writing chunks of the front buffer (incorrectly if there was an error), until presumably the writer would be killed by read hangup elsewhere.
2022-12-25 19:24:16 +11:00
Matt Joiner
079599b91b
Don't use path.Join in default webseed path escaper
Thanks fuzzing!
2022-12-25 18:20:42 +11:00
Matt Joiner
df126fcace
Add fuzzing for webseed path escaping 2022-12-25 18:20:23 +11:00
Matt Joiner
291c428016
Change default webseed path escaping to work for all S3-compatible providers 2022-12-23 11:18:36 +11:00
a
48ad1a8aca
update deps (#794) 2022-12-22 11:07:40 +11:00
Matt Joiner
b06b614845
Make trackerServer package 2022-12-18 10:56:25 +11:00
Matt Joiner
16da3c0c46
Default to announcing as leecher 2022-12-17 11:08:46 +11:00
Matt Joiner
6731a31839
Pass seeders and leechers back in UDP announce 2022-12-17 11:08:35 +11:00
Matt Joiner
3371522119
Use port from announce request, not packet source 2022-12-16 15:39:02 +11:00
Matt Joiner
e554aa19a6
Add --port flag to announce 2022-12-16 15:38:30 +11:00
Matt Joiner
16c7621d9e
Set span errors 2022-12-16 13:22:44 +11:00
Matt Joiner
87e64b3088
Propagate announce interval, particularly for UDP 2022-12-15 23:21:08 +11:00
Matt Joiner
cbea87aaf3
Add upstream announce gating 2022-12-13 16:41:08 +11:00
Matt Joiner
ab4599b6b8
Add some tracing 2022-12-13 15:28:34 +11:00
Matt Joiner
cfe166c745
Don't use AnnounceHandler by value
It needs to share mutex for upstream tracker single flight handling.
2022-12-12 11:23:33 +11:00
Matt Joiner
f75989863c
Validate received chunks before conversion to indexes
https://github.com/anacrolix/torrent/issues/791
2022-12-11 15:21:23 +11:00
Matt Joiner
0a4de1821e
Fix error message for connection ID mismatch 2022-12-08 15:07:14 +11:00
Matt Joiner
5cedf602f2
Make UDP tracker connection ID unsigned
This is more appropriate for logging and its use as a byte blob elsewhere.
2022-12-08 15:06:59 +11:00
Matt Joiner
91bde5fdf0
Use ConnectionId type alias 2022-12-08 15:06:05 +11:00
Matt Joiner
acb09fcf79
Add get peers limits 2022-12-08 14:04:43 +11:00
Matt Joiner
1028161833
Use smaller parameter type 2022-12-08 14:04:42 +11:00
Matt Joiner
e5f00e9a82
Fix goroutine leak when augmenting peers from upstream 2022-12-08 13:39:58 +11:00
Marco Vidonis
3909c6c125
Add customer headers when dialling WS connection to tracker (#789)
* expose WebtorrentTrackerHttpHeader field
2022-12-08 09:17:33 +11:00
Matt Joiner
26c226f88f
Fix missing log argument 2022-12-07 10:45:13 +11:00
Matt Joiner
68dc90a7f7
Rework logging 2022-12-07 10:45:12 +11:00
Matt Joiner
c23269d1cc
Support upstream trackers 2022-12-07 10:45:12 +11:00
Matt Joiner
425a91c921
Support alternate remote host resolution 2022-12-07 10:45:12 +11:00
Matt Joiner
6b5c2fa1b0
Support HTTP tracker server 2022-12-07 10:45:12 +11:00