diff options
author | Martin Petersson <martin.petersson@nokia.com> | 2011-04-28 10:07:07 (GMT) |
---|---|---|
committer | Qt Commercial Integration <QtCommercial@digia.com> | 2012-01-31 10:24:42 (GMT) |
commit | 0c4638713ef9789770f758dd83a3f100c778cccc (patch) | |
tree | dd91e1c06dbf2d76c24f7c3cd3296981fa38f942 /src | |
parent | 09846b2babe782e799c9caf1ee08de80feb303e4 (diff) | |
download | Qt-0c4638713ef9789770f758dd83a3f100c778cccc.zip Qt-0c4638713ef9789770f758dd83a3f100c778cccc.tar.gz Qt-0c4638713ef9789770f758dd83a3f100c778cccc.tar.bz2 |
QAbstractSocket: Fix waitForReadyRead infinite loop.
Make sure that waitForReadyRead times out if the read buffer is full.
Task-number: QTBUG-16123
Reviewed-by: Peter Hartmann
Diffstat (limited to 'src')
-rw-r--r-- | src/network/socket/qabstractsocket.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp index bd4c9e4..fd33b5f 100644 --- a/src/network/socket/qabstractsocket.cpp +++ b/src/network/socket/qabstractsocket.cpp @@ -1863,7 +1863,7 @@ bool QAbstractSocket::waitForReadyRead(int msecs) } Q_ASSERT(d->socketEngine); - forever { + do { bool readyToRead = false; bool readyToWrite = false; if (!d->socketEngine->waitForReadOrWrite(&readyToRead, &readyToWrite, true, !d->writeBuffer.isEmpty(), @@ -1890,7 +1890,7 @@ bool QAbstractSocket::waitForReadyRead(int msecs) if (state() != ConnectedState) return false; - } + } while (qt_timeout_value(msecs, stopWatch.elapsed()) > 0); return false; } |