Skip to content

Commit

Permalink
[EventEngine] Return error instead of assertion when hostname is empt…
Browse files Browse the repository at this point in the history
…y in cf_engine (grpc#35353)

<!--

If you know who should review your pull request, please assign it to that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the appropriate
lang label.

-->

Closes grpc#35353

COPYBARA_INTEGRATE_REVIEW=grpc#35353 from yijiem:fix-ios-dns-test f84d29a
PiperOrigin-RevId: 592339589
  • Loading branch information
yijiem authored and copybara-github committed Dec 19, 2023
1 parent 3e785d3 commit 07b7ea7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/core/lib/event_engine/cf_engine/dns_service_resolver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,14 @@ void DNSServiceResolverImpl::LookupHostname(
});
return;
}
GPR_ASSERT(!host.empty());
if (host.empty()) {
engine_->Run([on_resolve = std::move(on_resolve),
status = absl::InvalidArgumentError(absl::StrCat(
"host must not be empty in name: ", name))]() mutable {
on_resolve(status);
});
return;
}
if (port_string.empty()) {
if (default_port.empty()) {
engine_->Run([on_resolve = std::move(on_resolve),
Expand Down

0 comments on commit 07b7ea7

Please sign in to comment.