diff options
author | Martin Petersson <Martin.Petersson@nokia.com> | 2012-06-04 16:34:13 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-26 11:32:21 +0200 |
commit | 1ce203d05a952f039105d30968daf2eacae66be8 (patch) | |
tree | 3db7e1740e84550f4e7e2fb77ffcf8072d4af74d /src/corelib/io/qfiledevice.cpp | |
parent | bf6897edb01c0d46fda5195e36bb529dbbf7e5dc (diff) |
QAbstractSocket: Enable readNotifier on read from buffer
This is needed for the QSslSocket. When we read on that socket we will
only read from the QIODevice buffer to get the unencrypted data.
So when the readNotifier has been turned off on the plainsocket there
is nothing to trigger it to be turned on again.
This will add a readData with zero size when we have read everything
from the buffer. This is so that we get a call into the socket to
check if the readNotifier should be turned on again.
Change-Id: I3b63e33de007db823e964480903186eb1b8caac2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qfiledevice.cpp')
-rw-r--r-- | src/corelib/io/qfiledevice.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/corelib/io/qfiledevice.cpp b/src/corelib/io/qfiledevice.cpp index e1f1db9ead..fc1bc6009a 100644 --- a/src/corelib/io/qfiledevice.cpp +++ b/src/corelib/io/qfiledevice.cpp @@ -459,6 +459,8 @@ qint64 QFileDevice::readLineData(char *data, qint64 maxlen) qint64 QFileDevice::readData(char *data, qint64 len) { Q_D(QFileDevice); + if (!len) + return 0; unsetError(); if (!d->ensureFlushed()) return -1; |