diff options
author | Joerg Bornemann <joerg.bornemann@nokia.com> | 2009-09-10 15:48:17 (GMT) |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@nokia.com> | 2009-09-10 15:50:40 (GMT) |
commit | 29259d93691f0fc7790108c00a8718c07fa3ae5e (patch) | |
tree | 50b2feb50bb1919e3fa9ae0becb6c4c83532a02f /src/network/socket | |
parent | 04c518e7629945a48e7e8e9216229cc879055ff4 (diff) | |
download | Qt-29259d93691f0fc7790108c00a8718c07fa3ae5e.zip Qt-29259d93691f0fc7790108c00a8718c07fa3ae5e.tar.gz Qt-29259d93691f0fc7790108c00a8718c07fa3ae5e.tar.bz2 |
QLocalSocket::readData (Windows) must return -1 on EOF
If we've detected a broken pipe and we have no more data in the
read buffer, then we return -1 to signal EOF.
Additionally, we close the QLocalSocket.
Reviewed-by: ossi
Diffstat (limited to 'src/network/socket')
-rw-r--r-- | src/network/socket/qlocalsocket_win.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/network/socket/qlocalsocket_win.cpp b/src/network/socket/qlocalsocket_win.cpp index 93e0958..d6e70be 100644 --- a/src/network/socket/qlocalsocket_win.cpp +++ b/src/network/socket/qlocalsocket_win.cpp @@ -200,7 +200,10 @@ qint64 QLocalSocket::readData(char *data, qint64 maxSize) } if (d->pipeClosed) { - QTimer::singleShot(0, this, SLOT(_q_pipeClosed())); + if (readSoFar == 0) { + QTimer::singleShot(0, this, SLOT(_q_pipeClosed())); + return -1; // signal EOF + } } else { if (!d->readSequenceStarted) d->startAsyncRead(); |