summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@nokia.com>2009-09-10 15:48:17 (GMT)
committerJoerg Bornemann <joerg.bornemann@nokia.com>2009-09-10 15:50:40 (GMT)
commit29259d93691f0fc7790108c00a8718c07fa3ae5e (patch)
tree50b2feb50bb1919e3fa9ae0becb6c4c83532a02f /src/network
parent04c518e7629945a48e7e8e9216229cc879055ff4 (diff)
downloadQt-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')
-rw-r--r--src/network/socket/qlocalsocket_win.cpp5
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();