summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShane Kearns <shane.kearns@accenture.com>2010-12-08 19:33:18 (GMT)
committerShane Kearns <shane.kearns@accenture.com>2010-12-08 19:33:18 (GMT)
commit92705ba069945bdd9a65b627d89119a893c0cf1e (patch)
tree463b7657e6e2730346fc9759b2d95efa34c79d6e
parent82ab30acff0322f51f732c520dd1e5d7b40482a6 (diff)
downloadQt-92705ba069945bdd9a65b627d89119a893c0cf1e.zip
Qt-92705ba069945bdd9a65b627d89119a893c0cf1e.tar.gz
Qt-92705ba069945bdd9a65b627d89119a893c0cf1e.tar.bz2
Fix handling of select ioctl results
The select ioctl report everything not just the flags we asked for. So mask off the results to only look at the requested flags. Reviewed-by: Markus Goetz
-rw-r--r--src/network/socket/qsymbiansocketengine.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/network/socket/qsymbiansocketengine.cpp b/src/network/socket/qsymbiansocketengine.cpp
index 2af2029..b1d8bc0 100644
--- a/src/network/socket/qsymbiansocketengine.cpp
+++ b/src/network/socket/qsymbiansocketengine.cpp
@@ -986,12 +986,12 @@ int QSymbianSocketEnginePrivate::nativeSelect(int timeout, bool checkRead, bool
asyncSelect->IssueRequest(); //TODO: in error case should we restart or not?
return err;
}
- if (selectFlags() & KSockSelectRead) {
- Q_ASSERT(checkRead && selectForRead);
+ if (checkRead && (selectFlags() & KSockSelectRead)) {
+ Q_ASSERT(selectForRead);
*selectForRead = true;
}
- if (selectFlags() & KSockSelectWrite) {
- Q_ASSERT(checkWrite && selectForWrite);
+ if (checkWrite && (selectFlags() & KSockSelectWrite)) {
+ Q_ASSERT(selectForWrite);
*selectForWrite = true;
}
//restart asynchronous notifier (only one IOCTL allowed at a time)
@@ -1417,6 +1417,7 @@ void QAsyncSelect::RunL()
// return;
m_inSocketEvent = true;
+ m_selectBuf() &= m_selectFlags; //the select ioctl reports everything, so mask to only what we requested
//TODO: KSockSelectReadContinuation does what?
if (m_selectBuf() & KSockSelectRead) {
QEvent e(QEvent::SockAct);