-
Notifications
You must be signed in to change notification settings - Fork 26
transport: Allow changing DNS resolver config #384
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
Changes from 6 commits
f005b16
5b32479
8dd7a38
3980f4a
c09c062
5be3bd8
0e63a53
7af787c
5c23a15
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -23,9 +23,10 @@ | |||||||||||||
| use crate::{error::DialError, transport::manager::TransportHandle, types::ConnectionId, PeerId}; | ||||||||||||||
|
|
||||||||||||||
| use futures::Stream; | ||||||||||||||
| use hickory_resolver::TokioResolver; | ||||||||||||||
| use multiaddr::Multiaddr; | ||||||||||||||
|
|
||||||||||||||
| use std::{fmt::Debug, time::Duration}; | ||||||||||||||
| use std::{fmt::Debug, sync::Arc, time::Duration}; | ||||||||||||||
|
|
||||||||||||||
| pub(crate) mod common; | ||||||||||||||
| #[cfg(feature = "quic")] | ||||||||||||||
|
|
@@ -177,7 +178,11 @@ pub(crate) trait TransportBuilder { | |||||||||||||
| type Transport: Transport; | ||||||||||||||
|
|
||||||||||||||
| /// Create new [`Transport`] object. | ||||||||||||||
| fn new(context: TransportHandle, config: Self::Config) -> crate::Result<(Self, Vec<Multiaddr>)> | ||||||||||||||
| fn new( | ||||||||||||||
| context: TransportHandle, | ||||||||||||||
| config: Self::Config, | ||||||||||||||
| resolver: Arc<TokioResolver>, | ||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Im wondering if we could move the resolver to the Tcp / Websocket config as: litep2p/src/protocol/libp2p/identify.rs Lines 77 to 81 in 8618470
And here litep2p populates the fields: Line 289 in 8618470
This way we could avoid passing the extra resolver as parameter and move it to the config itself. What do you think?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @lexnv I think that was me who suggested/approved the use of an extra argument, because the resolver doesn't fit into the user-facing tcp/websocket
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cool cool, that makes sense, we could go ahead and merge this 🙏 |
||||||||||||||
| ) -> crate::Result<(Self, Vec<Multiaddr>)> | ||||||||||||||
| where | ||||||||||||||
| Self: Sized; | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.