Skip to content

Commit f7b1fa6

Browse files
author
serge-sans-paille
committed
[NFC] remove unreferenced function ResolveIPV4HostName
Differential Revision: https://reviews.llvm.org/D104856
1 parent 96f6873 commit f7b1fa6

File tree

1 file changed

+0
-32
lines changed

1 file changed

+0
-32
lines changed

lldb/tools/debugserver/source/RNBSocket.cpp

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -30,38 +30,6 @@
3030
#include "lockdown.h"
3131
#endif
3232

33-
/* Once we have a RNBSocket object with a port # specified,
34-
this function is called to wait for an incoming connection.
35-
This function blocks while waiting for that connection. */
36-
37-
bool ResolveIPV4HostName(const char *hostname, in_addr_t &addr) {
38-
if (hostname == NULL || hostname[0] == '\0' ||
39-
strcmp(hostname, "localhost") == 0 ||
40-
strcmp(hostname, "127.0.0.1") == 0) {
41-
addr = htonl(INADDR_LOOPBACK);
42-
return true;
43-
} else if (strcmp(hostname, "*") == 0) {
44-
addr = htonl(INADDR_ANY);
45-
return true;
46-
} else {
47-
// See if an IP address was specified as numbers
48-
int inet_pton_result = ::inet_pton(AF_INET, hostname, &addr);
49-
50-
if (inet_pton_result == 1)
51-
return true;
52-
53-
struct hostent *host_entry = gethostbyname(hostname);
54-
if (host_entry) {
55-
std::string ip_str(
56-
::inet_ntoa(*(struct in_addr *)*host_entry->h_addr_list));
57-
inet_pton_result = ::inet_pton(AF_INET, ip_str.c_str(), &addr);
58-
if (inet_pton_result == 1)
59-
return true;
60-
}
61-
}
62-
return false;
63-
}
64-
6533
rnb_err_t RNBSocket::Listen(const char *listen_host, uint16_t port,
6634
PortBoundCallback callback,
6735
const void *callback_baton) {

0 commit comments

Comments
 (0)