summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-08-16 07:58:32 +0200
committerLiang Qi <liang.qi@qt.io>2016-08-16 07:58:32 +0200
commit17198e03ab36e5f579a1477b09cc3e601975eb5f (patch)
tree61ba826e9edd53469abdc1e1f58b1223d0336c56 /src/network
parenta5e89005445ac8ca18ac046eaf55fe2230e47cd6 (diff)
parent2e2b32a9ab459f6618d02e4b454c75a787172def (diff)
Merge remote-tracking branch 'origin/5.7' into dev
Conflicts: qmake/doc/src/qmake-manual.qdoc src/corelib/global/qglobal.cpp src/corelib/tools/qstring.cpp src/network/socket/qabstractsocket.cpp src/network/socket/qnativesocketengine_unix.cpp src/plugins/platforms/eglfs/api/qeglfsglobal.h Change-Id: Id5dfdbd30fa996f9b4b66a0b030b7d3b8c0ef288
Diffstat (limited to 'src/network')
-rw-r--r--src/network/kernel/qnetworkinterface.cpp2
-rw-r--r--src/network/kernel/qnetworkproxy.cpp4
-rw-r--r--src/network/socket/qabstractsocket.cpp22
-rw-r--r--src/network/socket/qlocalserver.cpp2
-rw-r--r--src/network/socket/qnativesocketengine_unix.cpp2
-rw-r--r--src/network/ssl/qsslsocket.cpp2
6 files changed, 19 insertions, 15 deletions
diff --git a/src/network/kernel/qnetworkinterface.cpp b/src/network/kernel/qnetworkinterface.cpp
index 22d2e6bb70..c5d1adbef0 100644
--- a/src/network/kernel/qnetworkinterface.cpp
+++ b/src/network/kernel/qnetworkinterface.cpp
@@ -365,7 +365,7 @@ void QNetworkAddressEntry::setBroadcast(const QHostAddress &newBroadcast)
Not all operating systems support reporting all features. Only the
IPv4 addresses are guaranteed to be listed by this class in all
platforms. In particular, IPv6 address listing is only supported
- on Windows, Linux, OS X and the BSDs.
+ on Windows, Linux, \macos and the BSDs.
\sa QNetworkAddressEntry
*/
diff --git a/src/network/kernel/qnetworkproxy.cpp b/src/network/kernel/qnetworkproxy.cpp
index 2f7e9d537d..bb1a7d0d8b 100644
--- a/src/network/kernel/qnetworkproxy.cpp
+++ b/src/network/kernel/qnetworkproxy.cpp
@@ -1557,7 +1557,7 @@ void QNetworkProxyFactory::setApplicationProxyFactory(QNetworkProxyFactory *fact
those settings are not found, this function will attempt to obtain
Internet Explorer's settings and use them.
- On MacOS X, this function will obtain the proxy settings using the
+ On \macos, this function will obtain the proxy settings using the
SystemConfiguration framework from Apple. It will apply the FTP,
HTTP and HTTPS proxy configurations for queries that contain the
protocol tag "ftp", "http" and "https", respectively. If the SOCKS
@@ -1576,7 +1576,7 @@ void QNetworkProxyFactory::setApplicationProxyFactory(QNetworkProxyFactory *fact
listed here.
\list
- \li On MacOS X, this function will ignore the Proxy Auto Configuration
+ \li On \macos, this function will ignore the Proxy Auto Configuration
settings, since it cannot execute the associated ECMAScript code.
\li On Windows platforms, this function may take several seconds to
diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp
index be60d187ad..662c8e957e 100644
--- a/src/network/socket/qabstractsocket.cpp
+++ b/src/network/socket/qabstractsocket.cpp
@@ -428,7 +428,7 @@
allowed to rebind, even if they pass ReuseAddressHint. This option
provides more security than ShareAddress, but on certain operating
systems, it requires you to run the server with administrator privileges.
- On Unix and OS X, not sharing is the default behavior for binding
+ On Unix and \macos, not sharing is the default behavior for binding
an address and port, so this option is ignored. On Windows, this
option uses the SO_EXCLUSIVEADDRUSE socket option.
@@ -438,7 +438,7 @@
socket option.
\value DefaultForPlatform The default option for the current platform.
- On Unix and OS X, this is equivalent to (DontShareAddress
+ On Unix and \macos, this is equivalent to (DontShareAddress
+ ReuseAddressHint), and on Windows, its equivalent to ShareAddress.
*/
@@ -702,10 +702,11 @@ bool QAbstractSocketPrivate::canReadNotification()
}
// If buffered, read data from the socket into the read buffer
- qint64 newBytes = 0;
if (isBuffered) {
+ const qint64 oldBufferSize = buffer.size();
+
// Return if there is no space in the buffer
- if (readBufferMaxSize && buffer.size() >= readBufferMaxSize) {
+ if (readBufferMaxSize && oldBufferSize >= readBufferMaxSize) {
socketEngine->setReadNotificationEnabled(false);
#if defined (QABSTRACTSOCKET_DEBUG)
qDebug("QAbstractSocketPrivate::canReadNotification() buffer is full");
@@ -715,7 +716,6 @@ bool QAbstractSocketPrivate::canReadNotification()
// If reading from the socket fails after getting a read
// notification, close the socket.
- newBytes = buffer.size();
if (!readFromSocket()) {
#if defined (QABSTRACTSOCKET_DEBUG)
qDebug("QAbstractSocketPrivate::canReadNotification() disconnecting socket");
@@ -723,12 +723,16 @@ bool QAbstractSocketPrivate::canReadNotification()
q->disconnectFromHost();
return false;
}
- newBytes = buffer.size() - newBytes;
+
+ // Return if there is no new data available.
+ if (buffer.size() == oldBufferSize) {
+ // If the socket is opened only for writing, return true
+ // to indicate that the data was discarded.
+ return !q->isReadable();
+ }
}
- // Only emit readyRead() if there is data available.
- if (newBytes > 0 || !isBuffered)
- emitReadyRead();
+ emitReadyRead();
// If we were closed as a result of the readyRead() signal,
// return.
diff --git a/src/network/socket/qlocalserver.cpp b/src/network/socket/qlocalserver.cpp
index a1085f726a..94143c2dc0 100644
--- a/src/network/socket/qlocalserver.cpp
+++ b/src/network/socket/qlocalserver.cpp
@@ -147,7 +147,7 @@ QLocalServer::~QLocalServer()
and are created based on the umask. Setting the access flags will
overide this and will restrict or permit access as specified.
- Other Unix-based operating systems, such as OS X, do not
+ Other Unix-based operating systems, such as \macos, do not
honor file permissions for Unix domain sockets and by default
have WorldAccess and these permission flags will have no effect.
diff --git a/src/network/socket/qnativesocketengine_unix.cpp b/src/network/socket/qnativesocketengine_unix.cpp
index d7d7dad8e7..d1efc21e09 100644
--- a/src/network/socket/qnativesocketengine_unix.cpp
+++ b/src/network/socket/qnativesocketengine_unix.cpp
@@ -317,7 +317,7 @@ int QNativeSocketEnginePrivate::option(QNativeSocketEngine::SocketOption opt) co
case QNativeSocketEngine::BindExclusively:
case QNativeSocketEngine::NonBlockingSocketOption:
case QNativeSocketEngine::BroadcastSocketOption:
- return true;
+ return -1;
case QNativeSocketEngine::MaxStreamsSocketOption: {
#ifndef QT_NO_SCTP
sctp_initmsg sctpInitMsg;
diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp
index 2371dd7212..29e1f32815 100644
--- a/src/network/ssl/qsslsocket.cpp
+++ b/src/network/ssl/qsslsocket.cpp
@@ -142,7 +142,7 @@
addDefaultCaCertificates(), and QSslConfiguration::defaultConfiguration().setCaCertificates().
\endlist
- \note If available, root certificates on Unix (excluding OS X) will be
+ \note If available, root certificates on Unix (excluding \macos) will be
loaded on demand from the standard certificate directories. If you do not
want to load root certificates on demand, you need to call either
QSslConfiguration::defaultConfiguration().setCaCertificates() before the first