diff options
author | David Faure <david.faure@kdab.com> | 2013-09-11 00:41:31 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-12-20 09:30:05 +0100 |
commit | 13c246ee119fdb10d91f509b968a221d4fc1d8ba (patch) | |
tree | a3a526e62e7ac7044bad9df2a9cdf37f31aacc62 /src/network/socket | |
parent | 8fb497d1f49d382cd0a26e396bc17d1edd615fb4 (diff) |
QAbstractSocket: fix setReadBufferSize from readyRead slot.
In a slot connected to readyRead, if the app detects that the
buffer size is too small and increases it, it expects that
readyRead() will be emitted again.
setReadBufferSize() doesn't re-enable the socket notifier when
calling from within readyRead, and readyRead itself was missing
the code to do it.
Change-Id: Ia00a3066ad3ba09d5cfae0716adc5691ae96c3fa
Done-with: Thiago
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/network/socket')
-rw-r--r-- | src/network/socket/qabstractsocket.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp index 47fec38283..f26f3de280 100644 --- a/src/network/socket/qabstractsocket.cpp +++ b/src/network/socket/qabstractsocket.cpp @@ -736,8 +736,8 @@ bool QAbstractSocketPrivate::canReadNotification() return true; } - if (!hasData && socketEngine) - socketEngine->setReadNotificationEnabled(true); + if (isBuffered && socketEngine) + socketEngine->setReadNotificationEnabled(readBufferMaxSize == 0 || readBufferMaxSize > q->bytesAvailable()); // reset the read socket notifier state if we reentered inside the // readyRead() connected slot. |