summaryrefslogtreecommitdiffstats
path: root/src/network/socket
diff options
context:
space:
mode:
authorShane Kearns <shane.kearns@accenture.com>2010-12-09 10:05:03 (GMT)
committerShane Kearns <shane.kearns@accenture.com>2010-12-09 10:07:19 (GMT)
commitb9080b96b05988776daec35f7e2af9ad346abb0a (patch)
tree63410cfeb10d51d83a4189739c35d1b10d0d3d01 /src/network/socket
parent92f11bd666e8a63d9fc8c5588d843721c5bf68b5 (diff)
downloadQt-b9080b96b05988776daec35f7e2af9ad346abb0a.zip
Qt-b9080b96b05988776daec35f7e2af9ad346abb0a.tar.gz
Qt-b9080b96b05988776daec35f7e2af9ad346abb0a.tar.bz2
Fix bug in select
When waitForRead was called, it was selecting for read and write, because we were checking the pointers instead of the bools. Reviewed-by: Markus Goetz
Diffstat (limited to 'src/network/socket')
-rw-r--r--src/network/socket/qsymbiansocketengine.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/network/socket/qsymbiansocketengine.cpp b/src/network/socket/qsymbiansocketengine.cpp
index 5cee340..1490bdd 100644
--- a/src/network/socket/qsymbiansocketengine.cpp
+++ b/src/network/socket/qsymbiansocketengine.cpp
@@ -148,7 +148,11 @@ bool QSymbianSocketEnginePrivate::createNewSocket(QAbstractSocket::SocketType so
TUint family = (socketProtocol == QAbstractSocket::IPv6Protocol) ? KAfInet6 : KAfInet;
TUint type = (socketType == QAbstractSocket::UdpSocket) ? KSockDatagram : KSockStream;
TUint protocol = (socketType == QAbstractSocket::UdpSocket) ? KProtocolInetUdp : KProtocolInetTcp;
- TInt err = nativeSocket.Open(socketServer, family, type, protocol, *connection);
+ TInt err;
+ if (connection)
+ err = nativeSocket.Open(socketServer, family, type, protocol, *connection);
+ else
+ err = nativeSocket.Open(socketServer, family, type, protocol); //TODO: FIXME - deprecated API, make sure we always have a connection instead
if (err != KErrNone) {
switch (err) {
@@ -946,9 +950,9 @@ int QSymbianSocketEnginePrivate::nativeSelect(int timeout, bool checkRead, bool
TPckgBuf<TUint> selectFlags;
selectFlags() = KSockSelectExcept;
- if (selectForRead)
+ if (checkRead)
selectFlags() |= KSockSelectRead;
- if (selectForWrite)
+ if (checkWrite)
selectFlags() |= KSockSelectWrite;
TRequestStatus selectStat;
nativeSocket.Ioctl(KIOctlSelect, selectStat, &selectFlags, KSOLSocket);