Skip to content
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

[http] Wrong domain name fail immediately #329

Merged
merged 1 commit into from
Jan 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions net/http/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ ISocketStream* PooledDialer::dial(std::string_view host, uint16_t port, bool sec
std::string strhost(host);
auto ipaddr = resolver->resolve(strhost.c_str());
if (ipaddr.undefined()) {
LOG_ERROR_RETURN(0, nullptr, "DNS resolve failed, name = `", host)
LOG_ERROR_RETURN(ENOENT, nullptr, "DNS resolve failed, name = `", host)
}

EndPoint ep(ipaddr, port);
Expand Down Expand Up @@ -165,7 +165,7 @@ class ClientImpl : public Client {
? m_dialer.dial(m_proxy_url, tmo.timeout())
: m_dialer.dial(req, tmo.timeout());
if (!s) {
if (errno == ECONNREFUSED) {
if (errno == ECONNREFUSED || errno == ENOENT) {
LOG_ERROR_RETURN(0, ROUNDTRIP_FAST_RETRY, "connection refused")
}
LOG_ERROR_RETURN(0, ROUNDTRIP_NEED_RETRY, "connection failed");
Expand Down
Loading