|
|
@ -73,7 +73,7 @@ class RegistryState { |
|
|
|
ResolverFactory* factory = |
|
|
|
ResolverFactory* factory = |
|
|
|
tmp_uri.ok() ? LookupResolverFactory(tmp_uri->scheme()) : nullptr; |
|
|
|
tmp_uri.ok() ? LookupResolverFactory(tmp_uri->scheme()) : nullptr; |
|
|
|
if (factory != nullptr) { |
|
|
|
if (factory != nullptr) { |
|
|
|
*uri = *tmp_uri; |
|
|
|
*uri = std::move(*tmp_uri); |
|
|
|
return factory; |
|
|
|
return factory; |
|
|
|
} |
|
|
|
} |
|
|
|
*canonical_target = absl::StrCat(default_prefix_.get(), target); |
|
|
|
*canonical_target = absl::StrCat(default_prefix_.get(), target); |
|
|
@ -81,7 +81,7 @@ class RegistryState { |
|
|
|
factory = |
|
|
|
factory = |
|
|
|
tmp_uri2.ok() ? LookupResolverFactory(tmp_uri2->scheme()) : nullptr; |
|
|
|
tmp_uri2.ok() ? LookupResolverFactory(tmp_uri2->scheme()) : nullptr; |
|
|
|
if (factory != nullptr) { |
|
|
|
if (factory != nullptr) { |
|
|
|
*uri = *tmp_uri2; |
|
|
|
*uri = std::move(*tmp_uri2); |
|
|
|
return factory; |
|
|
|
return factory; |
|
|
|
} |
|
|
|
} |
|
|
|
if (!tmp_uri.ok() || !tmp_uri2.ok()) { |
|
|
|
if (!tmp_uri.ok() || !tmp_uri2.ok()) { |
|
|
@ -158,18 +158,16 @@ OrphanablePtr<Resolver> ResolverRegistry::CreateResolver( |
|
|
|
std::shared_ptr<WorkSerializer> work_serializer, |
|
|
|
std::shared_ptr<WorkSerializer> work_serializer, |
|
|
|
std::unique_ptr<Resolver::ResultHandler> result_handler) { |
|
|
|
std::unique_ptr<Resolver::ResultHandler> result_handler) { |
|
|
|
GPR_ASSERT(g_state != nullptr); |
|
|
|
GPR_ASSERT(g_state != nullptr); |
|
|
|
std::string canonical_target; |
|
|
|
|
|
|
|
ResolverArgs resolver_args; |
|
|
|
ResolverArgs resolver_args; |
|
|
|
ResolverFactory* factory = g_state->FindResolverFactory( |
|
|
|
ResolverFactory* factory = g_state->FindResolverFactory( |
|
|
|
target, &resolver_args.uri, &canonical_target); |
|
|
|
target, &resolver_args.uri, &resolver_args.uri_string); |
|
|
|
|
|
|
|
if (factory == nullptr) return nullptr; |
|
|
|
|
|
|
|
if (resolver_args.uri_string.empty()) resolver_args.uri_string = target; |
|
|
|
resolver_args.args = args; |
|
|
|
resolver_args.args = args; |
|
|
|
resolver_args.pollset_set = pollset_set; |
|
|
|
resolver_args.pollset_set = pollset_set; |
|
|
|
resolver_args.work_serializer = std::move(work_serializer); |
|
|
|
resolver_args.work_serializer = std::move(work_serializer); |
|
|
|
resolver_args.result_handler = std::move(result_handler); |
|
|
|
resolver_args.result_handler = std::move(result_handler); |
|
|
|
OrphanablePtr<Resolver> resolver = |
|
|
|
return factory->CreateResolver(std::move(resolver_args)); |
|
|
|
factory == nullptr ? nullptr |
|
|
|
|
|
|
|
: factory->CreateResolver(std::move(resolver_args)); |
|
|
|
|
|
|
|
return resolver; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
std::string ResolverRegistry::GetDefaultAuthority(absl::string_view target) { |
|
|
|
std::string ResolverRegistry::GetDefaultAuthority(absl::string_view target) { |
|
|
|