summaryrefslogtreecommitdiffstats
path: root/src/network/socket
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2015-02-10 09:32:16 +0100
committerFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2015-02-10 09:42:25 +0100
commitfc35f714340d5361231506dfbead132122f59460 (patch)
treefd80498d9417c87b386a011f5849f1e4e48ad3fa /src/network/socket
parent6389160f04322449c34bd1ecfe53983e3b588943 (diff)
parent0d990b9ca117514fe83f53b39f25d6272304f2fb (diff)
Merge remote-tracking branch 'origin/5.4' into dev
Conflicts: src/3rdparty/harfbuzz-ng/harfbuzz-ng.pro src/gui/image/qimage_conversions.cpp src/gui/opengl/qopenglextensions_p.h src/gui/text/qtextengine.cpp src/network/ssl/qsslsocket_openssl.cpp src/plugins/platforms/eglfs/qeglfshooks_stub.cpp src/plugins/platforms/eglfs/qeglfsscreen.cpp src/plugins/platforms/eglfs/qeglfswindow.cpp src/plugins/platforms/windows/qwindowsfontdatabase.cpp src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp src/plugins/platforms/windows/qwindowsnativeinterface.cpp src/plugins/platforms/windows/qwindowsscreen.cpp src/plugins/platforms/windows/qwindowswindow.cpp src/plugins/platforms/windows/qwindowswindow.h src/plugins/platforms/xcb/qxcbdrag.h src/widgets/itemviews/qabstractitemview.cpp src/widgets/kernel/qwidget.cpp src/widgets/util/qsystemtrayicon_p.h tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp Thanks to Friedemann Kleint for resolving the qwindowsfontdatabase.cpp conflicts. Change-Id: I937232c30523d5121c195d947d92aec6f129b03e
Diffstat (limited to 'src/network/socket')
-rw-r--r--src/network/socket/qabstractsocket.cpp11
-rw-r--r--src/network/socket/qlocalsocket.cpp3
2 files changed, 9 insertions, 5 deletions
diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp
index 604214ce8e..5a1ad40b90 100644
--- a/src/network/socket/qabstractsocket.cpp
+++ b/src/network/socket/qabstractsocket.cpp
@@ -740,8 +740,15 @@ bool QAbstractSocketPrivate::canReadNotification()
return true;
}
- if ((isBuffered || socketType != QAbstractSocket::TcpSocket) && socketEngine)
- socketEngine->setReadNotificationEnabled(readBufferMaxSize == 0 || readBufferMaxSize > q->bytesAvailable());
+ if (socketEngine) {
+ // turn the socket engine off if we've either:
+ // - got pending datagrams
+ // - reached the buffer size limit
+ if (isBuffered)
+ socketEngine->setReadNotificationEnabled(readBufferMaxSize == 0 || readBufferMaxSize > q->bytesAvailable());
+ else if (socketType != QAbstractSocket::TcpSocket)
+ socketEngine->setReadNotificationEnabled(!socketEngine->hasPendingDatagrams());
+ }
// reset the read socket notifier state if we reentered inside the
// readyRead() connected slot.
diff --git a/src/network/socket/qlocalsocket.cpp b/src/network/socket/qlocalsocket.cpp
index 164117e84f..c1beedd53e 100644
--- a/src/network/socket/qlocalsocket.cpp
+++ b/src/network/socket/qlocalsocket.cpp
@@ -56,9 +56,6 @@ QT_BEGIN_NAMESPACE
waitForReadyRead(), waitForBytesWritten(), and waitForDisconnected()
which blocks until the operation is complete or the timeout expires.
- \note This feature is not supported on versions of Windows earlier than
- Windows XP.
-
\sa QLocalServer
*/