diff options
author | Joerg Bornemann <joerg.bornemann@digia.com> | 2012-11-02 11:13:18 (GMT) |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-11-05 12:51:12 (GMT) |
commit | edade424b755ad9e84699a1556cad90febe0e824 (patch) | |
tree | 1770b2313a8dbd7263c6f93b2f6639940c61d41f /src/network | |
parent | 621d9b15918ec9341190da50fe7dddc9a0276f34 (diff) | |
download | Qt-edade424b755ad9e84699a1556cad90febe0e824.zip Qt-edade424b755ad9e84699a1556cad90febe0e824.tar.gz Qt-edade424b755ad9e84699a1556cad90febe0e824.tar.bz2 |
fix bug in QLocalSocket::waitForReadyRead on Windows
We must not close the socket, if there's still data in the read buffer.
Also waitForReadyRead must return true, even if the pipe is broken after
we've read data.
QLocalSocket::readData will close the socket after the buffer has been
drained.
This fixes the flakiness of tst_QLocalSocket::threadedConnection.
In Qt5 large portions of this code has been rewritten and this fix does
not apply.
Task-number: QTBUG-27816
Task-number: QTQAINFRA-574
Change-Id: I467340d4dbab11056e6720b145a94a87156cb419
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/socket/qlocalsocket_win.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/network/socket/qlocalsocket_win.cpp b/src/network/socket/qlocalsocket_win.cpp index f26d98a..1c32a54 100644 --- a/src/network/socket/qlocalsocket_win.cpp +++ b/src/network/socket/qlocalsocket_win.cpp @@ -604,7 +604,7 @@ bool QLocalSocket::waitForReadyRead(int msecs) case WAIT_OBJECT_0: d->_q_notified(); // We just noticed that the pipe is gone. - if (d->pipeClosed) { + if (d->pipeClosed && !bytesAvailable()) { close(); return false; } |