summaryrefslogtreecommitdiffstats
path: root/src/network/socket/qnativesocketengine.cpp
diff options
context:
space:
mode:
authorPeter Hartmann <peter.hartmann@nokia.com>2009-10-27 15:04:29 (GMT)
committerPeter Hartmann <peter.hartmann@nokia.com>2009-10-27 15:38:38 (GMT)
commit2d0b29c312ddf422595ce9debb3678bb5c4d51b6 (patch)
treecc9a88dcdfbc10db62c9ff9f9cb930d1e805f171 /src/network/socket/qnativesocketengine.cpp
parentd0b0e0ed8ac857d78e497b74bb1c3596273c53ba (diff)
downloadQt-2d0b29c312ddf422595ce9debb3678bb5c4d51b6.zip
Qt-2d0b29c312ddf422595ce9debb3678bb5c4d51b6.tar.gz
Qt-2d0b29c312ddf422595ce9debb3678bb5c4d51b6.tar.bz2
QAbstractSocket: wait with closing until all bytes have been written
only disconnect from host when all bytes have been written; i.e. not only check whether the write buffer is empty, but also check whether the socket engine has still bytes to write. This is necessary for HTTP and SOCKS5 socket engine, because they both contain an inner TCP socket which also does buffering. For the native socket engine, there is no difference with this patch. Reviewed-by: Markus Goetz Reviewed-by: Thiago Macieira
Diffstat (limited to 'src/network/socket/qnativesocketengine.cpp')
-rw-r--r--src/network/socket/qnativesocketengine.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/network/socket/qnativesocketengine.cpp b/src/network/socket/qnativesocketengine.cpp
index e7f8401..a150b26 100644
--- a/src/network/socket/qnativesocketengine.cpp
+++ b/src/network/socket/qnativesocketengine.cpp
@@ -754,6 +754,12 @@ qint64 QNativeSocketEngine::write(const char *data, qint64 size)
return d->nativeWrite(data, size);
}
+
+qint64 QNativeSocketEngine::bytesToWrite() const
+{
+ return 0;
+}
+
/*!
Reads up to \a maxSize bytes into \a data from the socket.
Returns the number of bytes read, or -1 if an error occurred.