diff options
author | Iain <qt-info@nokia.com> | 2009-09-11 09:49:23 (GMT) |
---|---|---|
committer | Iain <qt-info@nokia.com> | 2009-09-11 09:49:23 (GMT) |
commit | 04fc98f2ed323c71a8671542f4f37faa988c434f (patch) | |
tree | 11a5dc618d6dfc27d8aafe3bf3a28981325a7304 /src/network/socket/qlocalsocket_win.cpp | |
parent | 3d4a2cd013f9e62788adf902a57ae8e2f31fccc7 (diff) | |
parent | 92789fabd6728820b244d23d7477f2a224a33f94 (diff) | |
download | Qt-04fc98f2ed323c71a8671542f4f37faa988c434f.zip Qt-04fc98f2ed323c71a8671542f4f37faa988c434f.tar.gz Qt-04fc98f2ed323c71a8671542f4f37faa988c434f.tar.bz2 |
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6
Diffstat (limited to 'src/network/socket/qlocalsocket_win.cpp')
-rw-r--r-- | src/network/socket/qlocalsocket_win.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/network/socket/qlocalsocket_win.cpp b/src/network/socket/qlocalsocket_win.cpp index ea85a62..8a745ab 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(); @@ -265,6 +268,8 @@ void QLocalSocketPrivate::startAsyncRead() // It may happen, that the other side closes the connection directly // after writing data. Then we must set the appropriate socket state. pipeClosed = true; + Q_Q(QLocalSocket); + emit q->readChannelFinished(); return; } default: @@ -326,6 +331,7 @@ DWORD QLocalSocketPrivate::bytesAvailable() } else { if (!pipeClosed) { pipeClosed = true; + emit q->readChannelFinished(); QTimer::singleShot(0, q, SLOT(_q_pipeClosed())); } } @@ -369,7 +375,8 @@ void QLocalSocket::close() QIODevice::close(); d->state = ClosingState; emit stateChanged(d->state); - emit readChannelFinished(); + if (!d->pipeClosed) + emit readChannelFinished(); d->serverName = QString(); d->fullServerName = QString(); @@ -448,6 +455,7 @@ void QLocalSocketPrivate::_q_notified() Q_Q(QLocalSocket); if (!completeAsyncRead()) { pipeClosed = true; + emit q->readChannelFinished(); return; } startAsyncRead(); |