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

3516 Commits

Author SHA1 Message Date
Matt Joiner
a11739a667
Attempt holepunch after initial dial fails 2023-05-11 13:03:54 +10:00
Matt Joiner
c8fd8884b1
Restore using just hex in peer extension expvar 2023-05-09 15:46:53 +10:00
Matt Joiner
20b437730d
Include count of peer conns in status 2023-05-09 15:46:53 +10:00
Matt Joiner
12db16c478
Drop peer request alloc reservations when peer is closed
Might fix a goroutine leak.
2023-05-09 15:46:53 +10:00
Matt Joiner
c202126a62
Add many more extension bit definitions 2023-05-09 15:46:53 +10:00
Matt Joiner
e9e21b9bb5
Add stats for connections that only occur due to holepunching 2023-05-09 15:46:52 +10:00
Matt Joiner
ba0b955f72
Remove bad half open count assertion 2023-05-09 15:46:52 +10:00
Matt Joiner
884b71ea6d
Add Client.Stats with ActiveHalfOpenAttempts 2023-05-09 15:46:52 +10:00
Matt Joiner
5a4456a7df
Fix race in TestUtpLocalPortIsReusable 2023-05-09 15:46:52 +10:00
Matt Joiner
0f2604e3e9
Support multiple ongoing half-open attempts 2023-05-09 15:46:52 +10:00
Matt Joiner
f3b61f09a8
Add internal panicif, check and nestedmaps packages
Fuckit I'm sick of reinventing the wheel.
2023-05-09 15:46:52 +10:00
Matt Joiner
5703f9b5eb
Locate target peer using dial addr when receiving a holepunch rendezvous 2023-05-09 15:46:51 +10:00
Matt Joiner
d1845bbede
go mod tidy 2023-05-09 15:45:52 +10:00
Matt Joiner
9624f6ff9c
Don't dial out TCP from the listen port 2023-05-09 15:45:52 +10:00
Matt Joiner
c0c7536caa
Add test showing that reusing TCP ports isn't a good idea 2023-05-09 15:45:52 +10:00
Matt Joiner
599846546e
Dial TCP with the listener's local addr 2023-05-09 15:45:52 +10:00
Matt Joiner
b290350ba2
Prefer outgoing connections from higher to lower peer IDs
I think it may have been wrong all this time.
2023-05-09 15:45:52 +10:00
Matt Joiner
16139e1168
Add more hole punching NOTES 2023-05-09 15:45:52 +10:00
Matt Joiner
267fab622d
Break PeerConn status into more lines and improve pex status 2023-05-09 15:45:52 +10:00
Matt Joiner
dc68e63298
Set torrent logger default level to debug 2023-05-09 15:45:51 +10:00
Matt Joiner
06a1aa0769
Synchronize holepunch connect messages with existing rendezvous 2023-05-09 15:45:50 +10:00
Matt Joiner
e86e624415
WIP support for ut_holepunch 2023-05-01 10:19:26 +10:00
Matt Joiner
60370d60d4
Order peer conn status by peer priority and show webseeds separately 2023-05-01 10:19:26 +10:00
Matt Joiner
6818a9f773
Rate limit received PEX messages per connection 2023-05-01 10:19:26 +10:00
Matt Joiner
1e13625c73
Misc debug status, pex conn tracking improvements 2023-05-01 10:19:24 +10:00
Matt Joiner
7e65e55c35
Rename prioritized_peers go files 2023-04-29 14:54:49 +10:00
Matt Joiner
a4989ec165
Camel case requestStrategy package 2023-04-29 14:54:49 +10:00
Matt Joiner
79ab1ffe2b
Try to balance incoming and outgoing conns per torrent 2023-04-29 14:54:49 +10:00
Matt Joiner
fdb0911e28
Don't log using torrent source as warning for context cancellation
This probably occurs because the info was obtained and we don't need to try the source anymore.
2023-04-04 19:13:14 +10:00
Matt Joiner
42d29d95a6
Import generics as g 2023-04-04 19:12:26 +10:00
Matt Joiner
069b92a98c
Add AddTorrentOpts.InfoBytes 2023-04-04 19:12:01 +10:00
Matt Joiner
8d3e86e3c0
Expose StringAddr 2023-04-03 15:10:54 +10:00
Matt Joiner
e13fd755ee
bencode: Only use unsafe.String for go>=1.20 2023-04-03 15:10:38 +10:00
Matt Joiner
872b11bd57
bencode: Support parsing strings into bool 2023-03-20 10:50:22 +11:00
Matt Joiner
c069849b40
Add Peer.Torrent
This was for accessing from callback events.
2023-03-01 14:17:29 +11:00
Matt Joiner
31bbd435f9
gorond 2023-03-01 12:34:35 +11:00
Matt Joiner
d3b3d2d9bf
Finish moving all Peer types and methods into peer.go 2023-03-01 12:34:16 +11:00
Matt Joiner
2ae264b6cc
Expose UDP tracker error response type 2023-02-24 16:20:08 +11:00
Matt Joiner
63982c3c80
Don't reconnect before sending requests with current conn ID
The tracker udp://tracker.torrent.eu.org:451/announce gives `error response: "Connection ID missmatch.\x00"` every 2 minutes when under heavy use. I suspect that reconnect requests are sent just after the connection ID is confirmed as not stale, but before it used for a request, and the server rejects the request after processing the reconnect first.

It might also just be that that tracker server implementation is lazy and marks everything stale on regular boundaries.
2023-02-20 15:49:55 +11:00
Matt Joiner
e8971ea0f1
Add unit test for relative availability after HaveNone
Could help with https://github.com/anacrolix/torrent/issues/813.
2023-02-19 13:24:25 +11:00
Matt Joiner
48b3e66c76
Add http and udp tracker server implementations 2023-02-19 12:08:23 +11:00
Matt Joiner
e8b04c7181
gofumpt 2023-02-18 18:35:22 +11:00
dependabot[bot]
81201050bc
Bump golang.org/x/net from 0.5.0 to 0.7.0 (#819)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.5.0 to 0.7.0.
- [Release notes](https://github.com/golang/net/releases)
- [Commits](https://github.com/golang/net/compare/v0.5.0...v0.7.0)

---
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>
2023-02-18 16:06:17 +11:00
Matt Joiner
2cb7121a93
Limit peer request data allocation
This follows up from abb5cbc96e301a4ca1f5df698b105ae8553ce1e9. We currently limit how many requests peers can send us, but didn't really check that peers didn't make us allocate huge amounts of space to buffer their requests. I'm sure there's some rough edges here.
2023-02-14 12:46:49 +11:00
dependabot[bot]
ceb7b2443a
Bump github.com/pion/dtls/v2 from 2.1.5 to 2.2.4 (#814)
Bumps [github.com/pion/dtls/v2](https://github.com/pion/dtls) from 2.1.5 to 2.2.4.
- [Release notes](https://github.com/pion/dtls/releases)
- [Commits](https://github.com/pion/dtls/compare/v2.1.5...v2.2.4)

---
updated-dependencies:
- dependency-name: github.com/pion/dtls/v2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-14 08:15:15 +11:00
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