From 0b706608fc93bbedbd525af4fb41f7e5cd6fb5d6 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 30 Aug 2018 10:59:05 +0200 Subject: QmlProfiler: Listen on QHostAddress::Any in QmlProfilerToolTest The attach dialog retrieves the host address to connect to from the device's toolControlChannel(). All of the toolControlChannel() implementations currently specify "localhost" as host address. "localhost" means IPv6 on macOS and IPv4 everywhere else. Unfortunately there is no shortcut for listening on a dual-stack local address in QTcpServer and urlFromLocalHostAndFreePort() will try both v4 and v6, returning whatever works. There is a shortcut for listening on a dual-stack "any" address, though. As this is only the test, we can live with exposing a TCP server to the internet for a short time. Change-Id: I4114f03668e608f80353d21a59edf67db4b7f738 Reviewed-by: Christian Stenger --- src/plugins/qmlprofiler/tests/qmlprofilertool_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/qmlprofiler/tests/qmlprofilertool_test.cpp b/src/plugins/qmlprofiler/tests/qmlprofilertool_test.cpp index fdba15f03d..1779e966e1 100644 --- a/src/plugins/qmlprofiler/tests/qmlprofilertool_test.cpp +++ b/src/plugins/qmlprofiler/tests/qmlprofilertool_test.cpp @@ -57,7 +57,7 @@ void QmlProfilerToolTest::testAttachToWaitingApplication() QUrl serverUrl = Utils::urlFromLocalHostAndFreePort(); QVERIFY(serverUrl.port() >= 0); QVERIFY(serverUrl.port() <= std::numeric_limits::max()); - server.listen(QHostAddress(serverUrl.host()), static_cast(serverUrl.port())); + server.listen(QHostAddress::Any, static_cast(serverUrl.port())); QScopedPointer connection; connect(&server, &QTcpServer::newConnection, this, [&]() { -- cgit v1.2.1