From 4f74076095add88c936e729838c9205abfe04bd0 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Tue, 22 Mar 2011 18:09:13 +0000 Subject: Ensure QSymbianHostResolver::DoCancel does correct thing based on state If a host resolver async call in progress, cancel it. Otherwise don't. Reviewed-by: Markus Goetz --- src/network/kernel/qhostinfo_symbian.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/network/kernel/qhostinfo_symbian.cpp b/src/network/kernel/qhostinfo_symbian.cpp index c1457fd..fdb0fbc 100644 --- a/src/network/kernel/qhostinfo_symbian.cpp +++ b/src/network/kernel/qhostinfo_symbian.cpp @@ -300,7 +300,16 @@ void QSymbianHostResolver::requestHostLookup() void QSymbianHostResolver::DoCancel() { - iHostResolver.Cancel(); +#if defined(QHOSTINFO_DEBUG) + qDebug() << "QSymbianHostResolver::DoCancel" << QThread::currentThreadId() << id() << (int)iState << this; +#endif + if (iState == EGetByAddress || iState == EGetByName) { + //these states have made an async request to host resolver + iHostResolver.Cancel(); + } else { + //for the self completing states there is nothing to cancel + Q_ASSERT(iState == EError); + } } void QSymbianHostResolver::RunL() -- cgit v0.12