-
Notifications
You must be signed in to change notification settings - Fork 11
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
transport/common: Share DNS lookups between TCP and WebSocket #151
Conversation
Signed-off-by: Alexandru Vasile <[email protected]>
Signed-off-by: Alexandru Vasile <[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.
LGTM! 👍
Signed-off-by: Alexandru Vasile <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
AddressType::Dns { | ||
address, | ||
port, | ||
dns_type, | ||
} => match dns_type { | ||
DnsType::Dns => Multiaddr::empty() | ||
.with(Protocol::Dns(Cow::Owned(address))) | ||
.with(Protocol::Tcp(port)), | ||
DnsType::Dns4 => Multiaddr::empty() | ||
.with(Protocol::Dns4(Cow::Owned(address))) | ||
.with(Protocol::Tcp(port)), | ||
DnsType::Dns6 => Multiaddr::empty() | ||
.with(Protocol::Dns6(Cow::Owned(address))) | ||
.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.
Here we had another miss-match, where regardless of the initial DNS version we'd accept both ipv4 or ipv6
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.
Nice!
## [0.6.0] - 2024-06-14 This release introduces breaking changes into `kad` module. The API has been extended as following: - An event `KademliaEvent::IncomingRecord` has been added. - New methods `KademliaHandle::store_record()` / `KademliaHandle::try_store_record()` have been introduced. This allows implementing manual incoming DHT record validation by configuring `Kademlia` with `IncomingRecordValidationMode::Manual`. Also, it is now possible to enable `TCP_NODELAY` on sockets. Multiple refactorings to remove the code duplications and improve the implementation robustness have been done. ### Added - Support manual DHT record insertion ([#135](#135)) - transport: Make `TCP_NODELAY` configurable ([#146](#146)) ### Changed - transport: Introduce common listener for tcp and websocket ([#147](#147)) - transport/common: Share DNS lookups between TCP and WebSocket ([#151](#151)) ### Fixed - ping: Make ping fault tolerant wrt outbound substreams races ([#133](#133)) - crypto/noise: Make noise fault tolerant ([#142](#142)) - protocol/notif: Fix panic on missing peer state ([#143](#143)) - transport: Fix erroneous handling of secondary connections ([#149](#149))
Move the dns resolving to a dedicated common module and return specific errors on failures.
Part of: #70