[Lldb-commits] [lldb] f7b1fa6 - [NFC] remove unreferenced function ResolveIPV4HostName
via lldb-commits
lldb-commits at lists.llvm.org
Fri Jun 25 04:47:05 PDT 2021
Author: serge-sans-paille
Date: 2021-06-25T13:45:11+02:00
New Revision: f7b1fa6f5ebec5780e626aa48d582f2519a01632
URL: https://github.com/llvm/llvm-project/commit/f7b1fa6f5ebec5780e626aa48d582f2519a01632
DIFF: https://github.com/llvm/llvm-project/commit/f7b1fa6f5ebec5780e626aa48d582f2519a01632.diff
LOG: [NFC] remove unreferenced function ResolveIPV4HostName
Differential Revision: https://reviews.llvm.org/D104856
Added:
Modified:
lldb/tools/debugserver/source/RNBSocket.cpp
Removed:
################################################################################
diff --git a/lldb/tools/debugserver/source/RNBSocket.cpp b/lldb/tools/debugserver/source/RNBSocket.cpp
index f2c4880fd4157..1282ea221625a 100644
--- a/lldb/tools/debugserver/source/RNBSocket.cpp
+++ b/lldb/tools/debugserver/source/RNBSocket.cpp
@@ -30,38 +30,6 @@
#include "lockdown.h"
#endif
-/* Once we have a RNBSocket object with a port # specified,
- this function is called to wait for an incoming connection.
- This function blocks while waiting for that connection. */
-
-bool ResolveIPV4HostName(const char *hostname, in_addr_t &addr) {
- if (hostname == NULL || hostname[0] == '\0' ||
- strcmp(hostname, "localhost") == 0 ||
- strcmp(hostname, "127.0.0.1") == 0) {
- addr = htonl(INADDR_LOOPBACK);
- return true;
- } else if (strcmp(hostname, "*") == 0) {
- addr = htonl(INADDR_ANY);
- return true;
- } else {
- // See if an IP address was specified as numbers
- int inet_pton_result = ::inet_pton(AF_INET, hostname, &addr);
-
- if (inet_pton_result == 1)
- return true;
-
- struct hostent *host_entry = gethostbyname(hostname);
- if (host_entry) {
- std::string ip_str(
- ::inet_ntoa(*(struct in_addr *)*host_entry->h_addr_list));
- inet_pton_result = ::inet_pton(AF_INET, ip_str.c_str(), &addr);
- if (inet_pton_result == 1)
- return true;
- }
- }
- return false;
-}
-
rnb_err_t RNBSocket::Listen(const char *listen_host, uint16_t port,
PortBoundCallback callback,
const void *callback_baton) {
More information about the lldb-commits
mailing list