summaryrefslogtreecommitdiffstats
path: root/src/network/kernel
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2023-09-04 20:14:21 +0200
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2023-09-07 03:26:37 +0200
commitf18082bbed0e67565a0c0fd4e088f7056e6796ed (patch)
tree8fac593fc98d1df4eb64de1c2de3fd48bfad8168 /src/network/kernel
parent55f0738f1638356137e6bd60459dc186ceaaabd8 (diff)
QHostInfo::abortLookup: ignore -1
The id -1 is the one of a default-constructed QHostInfo (invalid). It's also returned by various codepaths to mean a lookup failure. Attemping to abort its lookup should simply be ignored. Change-Id: I0413dd248a890f57195e4f5b5baea011b6737102 Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/network/kernel')
-rw-r--r--src/network/kernel/qhostinfo.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/network/kernel/qhostinfo.cpp b/src/network/kernel/qhostinfo.cpp
index 54d72e6e07..9be6abced0 100644
--- a/src/network/kernel/qhostinfo.cpp
+++ b/src/network/kernel/qhostinfo.cpp
@@ -998,6 +998,9 @@ void QHostInfoLookupManager::abortLookup(int id)
if (wasDeleted)
return;
+ if (id == -1)
+ return;
+
#if QT_CONFIG(thread)
// is postponed? delete and return
for (int i = 0; i < postponedLookups.size(); i++) {