diff options
author | Pavel Labath <labath@google.com> | 2017-04-19 10:13:22 +0000 |
---|---|---|
committer | Pavel Labath <labath@google.com> | 2017-04-19 10:13:22 +0000 |
commit | 107e694271b5b2679136de194f461c1b6c33463f (patch) | |
tree | b39334f192851936561e48467cf20fd3ee9bcfe7 /lldb/tools/debugserver/source/debugserver.cpp | |
parent | 742aed86833d23ad559c6437a0fc7ab47f3bbdf8 (diff) | |
download | llvm-107e694271b5b2679136de194f461c1b6c33463f.zip llvm-107e694271b5b2679136de194f461c1b6c33463f.tar.gz llvm-107e694271b5b2679136de194f461c1b6c33463f.tar.bz2 |
Revert yesterdays IPv6 patches
The break the linux bots (and probably any other machine which would
run the test suite in a massively parallel way). The problem is that it
can happen that we only successfully create an IPv6 listening socket
(because the relevant IPv4 port is used by another process) and then the
connecting side attempts to connect to the IPv4 port and fails.
It's not very obvious how to fix this problem, so I am reverting this
until we come up with a solution.
llvm-svn: 300669
Diffstat (limited to 'lldb/tools/debugserver/source/debugserver.cpp')
-rw-r--r-- | lldb/tools/debugserver/source/debugserver.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/lldb/tools/debugserver/source/debugserver.cpp b/lldb/tools/debugserver/source/debugserver.cpp index bc1954d..0cb72f4 100644 --- a/lldb/tools/debugserver/source/debugserver.cpp +++ b/lldb/tools/debugserver/source/debugserver.cpp @@ -1345,18 +1345,10 @@ int main(int argc, char *argv[]) { show_usage_and_exit(1); } // accept 'localhost:' prefix on port number - std::string host_specifier = argv[0]; - auto colon_location = host_specifier.rfind(':'); - if (colon_location != std::string::npos) { - host = host_specifier.substr(0, colon_location); - std::string port_str = - host_specifier.substr(colon_location + 1, std::string::npos); - char *end_ptr; - port = strtoul(port_str.c_str(), &end_ptr, 0); - if (end_ptr < port_str.c_str() + port_str.size()) - show_usage_and_exit(2); - if (host.front() == '[' && host.back() == ']') - host = host.substr(1, host.size() - 2); + + int items_scanned = ::sscanf(argv[0], "%[^:]:%i", str, &port); + if (items_scanned == 2) { + host = str; DNBLogDebug("host = '%s' port = %i", host.c_str(), port); } else { // No hostname means "localhost" |