summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@nokia.com>2010-04-12 14:26:19 (GMT)
committerJoerg Bornemann <joerg.bornemann@nokia.com>2010-04-12 14:29:58 (GMT)
commit9e43ab153dbbe83e1e7e2fb1e9d6815424c4b5f2 (patch)
treeec4975b2365ad34a8334030abf651319f4f0d150 /src/corelib/io
parent0f790634c57400f4ddffd36f5e3443c712d1a1c3 (diff)
downloadQt-9e43ab153dbbe83e1e7e2fb1e9d6815424c4b5f2.zip
Qt-9e43ab153dbbe83e1e7e2fb1e9d6815424c4b5f2.tar.gz
Qt-9e43ab153dbbe83e1e7e2fb1e9d6815424c4b5f2.tar.bz2
accelerate QWindowsPipeWriter for bigger chunks of data
Don't put pipes into message mode. This makes it possible to not split data into 2k chunks. Reviewed-by: ossi
Diffstat (limited to 'src/corelib/io')
-rw-r--r--src/corelib/io/qwindowspipewriter.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/corelib/io/qwindowspipewriter.cpp b/src/corelib/io/qwindowspipewriter.cpp
index 417439f..2fe4424 100644
--- a/src/corelib/io/qwindowspipewriter.cpp
+++ b/src/corelib/io/qwindowspipewriter.cpp
@@ -128,11 +128,9 @@ void QWindowsPipeWriter::run()
overl.OffsetHigh = 0;
while ((!quitNow) && totalWritten < maxlen) {
DWORD written = 0;
- // Write 2k at a time to prevent flooding the pipe. If you
- // write too much (4k-8k), the pipe can close
- // unexpectedly.
if (!WriteFile(writePipe, ptrData + totalWritten,
- qMin<int>(2048, maxlen - totalWritten), &written, &overl)) {
+ maxlen - totalWritten, &written, &overl)) {
+
if (GetLastError() == 0xE8/*NT_STATUS_INVALID_USER_BUFFER*/) {
// give the os a rest
msleep(100);