diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-06-14 18:25:15 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-06-14 18:25:15 (GMT) |
commit | 47249ef4ccf8014f5252a37252fc76a326e7818c (patch) | |
tree | 1b60bd41248fed507eee02384c0e5b9343679131 /src | |
parent | 7aa5b113f9fe39a24a80b5462d64b02e77ed20e7 (diff) | |
parent | d61a1fecde3d4a5b34a849ae852a498e6bb1c2de (diff) | |
download | Qt-47249ef4ccf8014f5252a37252fc76a326e7818c.zip Qt-47249ef4ccf8014f5252a37252fc76a326e7818c.tar.gz Qt-47249ef4ccf8014f5252a37252fc76a326e7818c.tar.bz2 |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1:
beautify tst_QLocalSocket::writeToClientAndDisconnect
QLocalSocket/Win: check for broken pipe in waitForReadyRead
QLocalSocket/Win: call close on async connection loss
Diffstat (limited to 'src')
-rw-r--r-- | src/network/socket/qlocalsocket_win.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/network/socket/qlocalsocket_win.cpp b/src/network/socket/qlocalsocket_win.cpp index 2223ebe..5486f47 100644 --- a/src/network/socket/qlocalsocket_win.cpp +++ b/src/network/socket/qlocalsocket_win.cpp @@ -485,6 +485,8 @@ void QLocalSocketPrivate::_q_notified() if (!completeAsyncRead()) { pipeClosed = true; emit q->readChannelFinished(); + if (actualReadBufferSize == 0) + QTimer::singleShot(0, q, SLOT(_q_pipeClosed())); return; } startAsyncRead(); @@ -568,11 +570,22 @@ bool QLocalSocket::waitForReadyRead(int msecs) if (d->state != QLocalSocket::ConnectedState) return false; + // We already know that the pipe is gone, but did not enter the event loop yet. + if (d->pipeClosed) { + close(); + return false; + } + Q_ASSERT(d->readSequenceStarted); DWORD result = WaitForSingleObject(d->overlapped.hEvent, msecs == -1 ? INFINITE : msecs); switch (result) { case WAIT_OBJECT_0: d->_q_notified(); + // We just noticed that the pipe is gone. + if (d->pipeClosed) { + close(); + return false; + } return true; case WAIT_TIMEOUT: return false; |