diff options
author | Shane Kearns <shane.kearns@accenture.com> | 2011-03-22 18:09:13 (GMT) |
---|---|---|
committer | Shane Kearns <shane.kearns@accenture.com> | 2011-03-23 11:04:23 (GMT) |
commit | 4f74076095add88c936e729838c9205abfe04bd0 (patch) | |
tree | 8b75a403b27b04115e320de303998cc63000c74c /src/network/kernel | |
parent | 1831e7f802d1bdba33f320c21f29df02d647ead8 (diff) | |
download | Qt-4f74076095add88c936e729838c9205abfe04bd0.zip Qt-4f74076095add88c936e729838c9205abfe04bd0.tar.gz Qt-4f74076095add88c936e729838c9205abfe04bd0.tar.bz2 |
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
Diffstat (limited to 'src/network/kernel')
-rw-r--r-- | src/network/kernel/qhostinfo_symbian.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
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() |