-
Notifications
You must be signed in to change notification settings - Fork 1k
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
transports/tcp: only translate tcp addresses #2970
Conversation
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.
LGTM!
let tcp_listen_addr = Multiaddr::empty() | ||
.with(Protocol::Ip4(Ipv4Addr::new(127, 0, 0, 1))) | ||
.with(Protocol::Tcp(port)); |
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.
I always find these easier to read if we parse them from a string.
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.
I prefer using types where possible, avoiding any unwraps that would be needed when parsing from string :)
Co-authored-by: Thomas Eizinger <[email protected]>
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.
Thank you for the fix @elenaf9!
Description
Return
None
in in<GenTcpTransport as Transport>::address_translation
if the address is not a tcp address.Relevant if in case of something like
OrTransport<TcpTransport, QuicTransport>
, where tcp would currently perform the address translation for quic addresses.Raise by @mxinden for quic in #2289 (comment), so I think the same should also be applied for the tcp transport.
Change checklist