Skip to content

Commit 6086a36

Browse files
committed
return 0 (false) from Client.connect(hostname,port) when DNS-lookup didn't succeed
1 parent a69c7a4 commit 6086a36

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

UIPClient.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,16 @@ int
7878
UIPClient::connect(const char *host, uint16_t port)
7979
{
8080
// Look up the host first
81-
int ret = 0;
8281
#if UIP_UDP
8382
DNSClient dns;
8483
IPAddress remote_addr;
8584

8685
dns.begin(UIPEthernet.dnsServerIP());
87-
ret = dns.getHostByName(host, remote_addr);
88-
if (ret == 1) {
86+
if (dns.getHostByName(host, remote_addr) == 1) {
8987
return connect(remote_addr, port);
9088
}
9189
#endif
92-
return ret;
90+
return 0;
9391
}
9492

9593
void

0 commit comments

Comments
 (0)