Skip to content
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

swarm: skip dialing WebTransport addresses when we have QUIC addresses #1756

Merged
merged 1 commit into from
Sep 19, 2022

Conversation

marten-seemann
Copy link
Contributor

@marten-seemann marten-seemann commented Sep 16, 2022

Question: Should we have something similar for WebSocket and TCP?

Copy link
Member

@mxinden mxinden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do I understand correctly that this would drop all webtransport addresses in case there is a single quic address?

In case a node advertises the following two address, the local node should still dial both, right?

"/ip4/1.2.3.4/udp/443/quic
"/ip4/5.6.7.8/udp/443/quic/webtransport

In other words, only if the addresses are equal on everything before quic, only then should the QUIC address replace the webtransport address.

Does that make sense?

@marten-seemann
Copy link
Contributor Author

In other words, only if the addresses are equal on everything before quic, only then should the QUIC address replace the webtransport address.

Yes, that would be better, but also more code. Not sure if it's worth the complexity.

@marten-seemann
Copy link
Contributor Author

Actually, this probably won't be too hard. I'll update the PR.

Comment on lines +551 to +556
if isQUIC(addr) {
hasQuic = true
}
if isWebTransport(addr) {
hasWebTransport = true
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if isQUIC(addr) {
hasQuic = true
}
if isWebTransport(addr) {
hasWebTransport = true
}
hasQuic = isQuic(addr)
hasWebTransport = isWebTransport(addr)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wait, this is not correct. The ifs are in a loop. Will revert.

@marten-seemann marten-seemann force-pushed the dont-dial-webtransport-when-have-quic branch from cdd27b7 to ebd6827 Compare September 19, 2022 06:25
@marten-seemann
Copy link
Contributor Author

Merging this simple version now. We can still have better logic later (or implement the proper Happy Eyeballs fix later).

@marten-seemann marten-seemann merged commit 5ef3208 into master Sep 19, 2022
@marten-seemann marten-seemann deleted the dont-dial-webtransport-when-have-quic branch September 19, 2022 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants