summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOliver Wolff <oliver.wolff@theqtcompany.com>2015-11-18 13:03:55 +0100
committerOliver Wolff <oliver.wolff@theqtcompany.com>2015-11-19 06:55:24 +0000
commitc63dbf8419cd40fd21422ccc73e231677f24b95c (patch)
tree940238d1c4db1d262e2867abc23e4969a37b3243 /src
parentfecbe76d6e24c4025cf8efb012571d1535a938ff (diff)
winrt: Set error if host cannot be found in QHostInfoAgent::fromName
Task-number: QTBUG-49478 Change-Id: Iab745100621db51219a42d575020783f6e9f310a Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
Diffstat (limited to 'src')
-rw-r--r--src/network/kernel/qhostinfo_winrt.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/network/kernel/qhostinfo_winrt.cpp b/src/network/kernel/qhostinfo_winrt.cpp
index 3d2344726b..0659e0ed55 100644
--- a/src/network/kernel/qhostinfo_winrt.cpp
+++ b/src/network/kernel/qhostinfo_winrt.cpp
@@ -49,6 +49,8 @@ using namespace ABI::Windows::Networking::Sockets;
QT_BEGIN_NAMESPACE
+#define E_NO_SUCH_HOST 0x80072af9
+
//#define QHOSTINFO_DEBUG
QHostInfo QHostInfoAgent::fromName(const QString &hostName)
@@ -98,8 +100,11 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName)
return results;
}
- if (!endpointPairs)
+ if (hr == E_NO_SUCH_HOST || !endpointPairs) {
+ results.setError(QHostInfo::HostNotFound);
+ results.setErrorString(tr("Host %1 could not be found.").arg(hostName));
return results;
+ }
unsigned int size;
endpointPairs->get_Size(&size);