summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-06-17 12:25:09 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-06-17 12:25:09 (GMT)
commit6e7be2f62affae41a7e9cb717778f4ef24f52c20 (patch)
tree24525d8437baece5c4c5e47fec11964e7f65d41f
parent0adaa5fd48b39b83e2e2b7693cbc2452e2076c15 (diff)
parent4d0c4b9f09b35d707d437611519d0024f6f87a8c (diff)
downloadQt-6e7be2f62affae41a7e9cb717778f4ef24f52c20.zip
Qt-6e7be2f62affae41a7e9cb717778f4ef24f52c20.tar.gz
Qt-6e7be2f62affae41a7e9cb717778f4ef24f52c20.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: QLocalSocket/Win: handle ERROR_MORE_DATA after read operation
-rw-r--r--src/network/socket/qlocalsocket_win.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/network/socket/qlocalsocket_win.cpp b/src/network/socket/qlocalsocket_win.cpp
index 5486f47..4907f2c 100644
--- a/src/network/socket/qlocalsocket_win.cpp
+++ b/src/network/socket/qlocalsocket_win.cpp
@@ -280,6 +280,12 @@ void QLocalSocketPrivate::startAsyncRead()
case ERROR_IO_PENDING:
// This is not an error. We're getting notified, when data arrives.
return;
+ case ERROR_MORE_DATA:
+ // This is not an error. The synchronous read succeeded.
+ // We're connected to a message mode pipe and the message
+ // didn't fit into the pipe's system buffer.
+ completeAsyncRead();
+ break;
case ERROR_PIPE_NOT_CONNECTED:
{
// It may happen, that the other side closes the connection directly
@@ -309,9 +315,18 @@ bool QLocalSocketPrivate::completeAsyncRead()
DWORD bytesRead;
if (!GetOverlappedResult(handle, &overlapped, &bytesRead, TRUE)) {
- if (GetLastError() != ERROR_PIPE_NOT_CONNECTED)
+ switch (GetLastError()) {
+ case ERROR_MORE_DATA:
+ // This is not an error. We're connected to a message mode
+ // pipe and the message didn't fit into the pipe's system
+ // buffer. We will read the remaining data in the next call.
+ break;
+ case ERROR_PIPE_NOT_CONNECTED:
setErrorString(QLatin1String("QLocalSocketPrivate::completeAsyncRead"));
- return false;
+ // fall through
+ default:
+ return false;
+ }
}
actualReadBufferSize += bytesRead;