-
-
Notifications
You must be signed in to change notification settings - Fork 644
adds bep_0014 (local peer discovery) #998
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Are you interested in refactoring it a bit (totally fine if not). I think we could move the LPD stuff into a separate package, probably just What are the licence requirements for this? I note @axet has forgotten the MPL2 licence throughout his codebase. He's got LGPL3 for his code, so does that need to be reflected here? |
Thanks :) |
There are some race conditions. Run the tests with -race on your system. |
bep14.go
Outdated
if client.LocalPort() == addr.Port { | ||
log.Println("discovered self") | ||
client.rUnlock() | ||
continue | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self is no longer discovered but only considering port number for the first listener that has one seems a bit fragile...
could publish peer id in the message but i guess this could cause parsing problems with other clients? https://bittorrent.org/beps/bep_0014.html
This is looking very good, thanks for taking feedback on board. I'll give a more detailed response shortly. |
adds network interface selection
go.mod
Outdated
go 1.23.0 | ||
|
||
toolchain go1.24.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a little confused about how i've caused this, i think it's because of requiring:
"golang.org/x/net/ipv4"
"golang.org/x/net/ipv6"
but i can't work out exactly why...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a bug in Go, they just pushed a fix to master golang/go#65847 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes i see something funky happening here
https://github.com/philrhc/torrent/actions/runs/14750112335/job/41406098250
Common Go seems to download 3 versions of the toolchain, 1.23.0, 1.23.8 and the upgraded 1.24.2. I wonder if this will happen to any pull request that upgrades the go version. I will investigate how this action cache works...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, i think the caching is working okay now that all versions of go are 1.24.2. I am speculating that some part of the code does not work with Windows and this causes the test timeout...
github.com/anacrolix/torrent/analysis github.com/anacrolix/torrent/bencode github.com/anacrolix/torrent/cmd/magnet-metainfo github.com/anacrolix/torrent/cmd/torrent github.com/anacrolix/torrent/cmd/torrent-pick github.com/anacrolix/torrent/cmd/torrent2 github.com/anacrolix/torrent/common github.com/anacrolix/torrent/dialer github.com/anacrolix/torrent/internal/alloclim github.com/anacrolix/torrent/internal/check github.com/anacrolix/torrent/internal/cmd/issue-464 github.com/anacrolix/torrent/internal/cmd/issue-465 github.com/anacrolix/torrent/internal/cmd/issue-906 github.com/anacrolix/torrent/internal/cmd/issue-908 github.com/anacrolix/torrent/internal/ctxrw github.com/anacrolix/torrent/internal/limiter github.com/anacrolix/torrent/internal/nestedmaps github.com/anacrolix/torrent/internal/panicif github.com/anacrolix/torrent/internal/testutil github.com/anacrolix/torrent/iplist github.com/anacrolix/torrent/iplist/cmd/iplist github.com/anacrolix/torrent/iplist/cmd/pack-blocklist github.com/anacrolix/torrent/logonce github.com/anacrolix/torrent/merkle github.com/anacrolix/torrent/metainfo github.com/anacrolix/torrent/mmap_span github.com/anacrolix/torrent/mse github.com/anacrolix/torrent/mse/cmd/mse github.com/anacrolix/torrent/peer_protocol github.com/anacrolix/torrent/peer_protocol/ut-holepunch github.com/anacrolix/torrent/request-strategy github.com/anacrolix/torrent/segments github.com/anacrolix/torrent/smartban github.com/anacrolix/torrent/storage github.com/anacrolix/torrent/storage/disabled github.com/anacrolix/torrent/storage/sqlite github.com/anacrolix/torrent/storage/test github.com/anacrolix/torrent/test github.com/anacrolix/torrent/tests/issue-798 github.com/anacrolix/torrent/tests/issue-930 github.com/anacrolix/torrent/tests/issue-952 github.com/anacrolix/torrent/tests/peers-bootstrapping github.com/anacrolix/torrent/tracker github.com/anacrolix/torrent/tracker/http github.com/anacrolix/torrent/tracker/http/server github.com/anacrolix/torrent/tracker/server github.com/anacrolix/torrent/tracker/shared github.com/anacrolix/torrent/tracker/udp github.com/anacrolix/torrent/tracker/udp/server github.com/anacrolix/torrent/typed-roaring github.com/anacrolix/torrent/types github.com/anacrolix/torrent/types/infohash github.com/anacrolix/torrent/types/infohash-v2 github.com/anacrolix/torrent/util/dirwatch github.com/anacrolix/torrent/version github.com/anacrolix/torrent/webseed github.com/anacrolix/torrent/webtorrent
This reverts commit f662df2.
i am currently not able to find the reason the windows runner cannot complete TestDiscovery. I'll give this a rest now... |
Ah, Windows probably does very different things with regard to multicast. I had to do similar hackery for anacrolix/dms. https://github.com/anacrolix/dms/blob/1291628af96c12c6a81ad900021f9da912bc8fd5/ssdp/ssdp.go#L115 |
good to know, thanks. I'm planning to take a look at this again soon |
This reverts commit 61f5c21.
hi, thought i'd check in :) thank you for the fantastic work over the years, it's been a pleasure to use torrent and confluence :) |
upstreams BEP14 from https://gitlab.com/axet/libtorrent/-/blob/master/lpd.go