-
Notifications
You must be signed in to change notification settings - Fork 1.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
feat: inject DNS resolver #1607
Conversation
config/constructor_types.go
Outdated
@@ -28,43 +29,47 @@ var ( | |||
connGaterType = reflect.TypeOf((*connmgr.ConnectionGater)(nil)).Elem() | |||
upgraderType = reflect.TypeOf((*transport.Upgrader)(nil)).Elem() | |||
rcmgrType = reflect.TypeOf((*network.ResourceManager)(nil)).Elem() | |||
resolverType = reflect.TypeOf((*madns.Resolver)(nil)).Elem() |
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.
Would be nice to use an interface instead of a concrete type here. madns.BasicResolver
?
Could it be that madns.Resolver
and madns.BasicResolver
should switch their names?
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.
So, madns.Resolver
is basically a light-weight wrapper over a set of BasicResolver
s that implements a multiaddr handing Resolve
method. The pluggable component is really madns.BasicResolver
, where the user should then construct an madns.Resolver
from one or more madns.BasicResolver
s.
ab00787
to
a2275a8
Compare
2022-08-19: this is needed for 0.23 to fix address resolution issues. This is related to #1597 . |
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.
a2275a8
to
daac04b
Compare
Rebased to resolve merge conflict in imports. |
This injects the DNS resolver into transport constructors.