From ca3933f90d770fe4ea080fe12311793262aae751 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 20 Nov 2015 17:41:46 +0100 Subject: Add missing \since to QSslCipher QString overload. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This was added in 5.3 in 30d199a76c7d30d9d70eb6cd7594826e7bf6de61. Change-Id: I35a209fcfe417cb14605c4db19a3d2e85b67ee49 Reviewed-by: Michał Dutkiewicz Reviewed-by: Marc Mutz --- src/network/ssl/qsslcipher.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/network') diff --git a/src/network/ssl/qsslcipher.cpp b/src/network/ssl/qsslcipher.cpp index c480b79371..302ba530d4 100644 --- a/src/network/ssl/qsslcipher.cpp +++ b/src/network/ssl/qsslcipher.cpp @@ -71,6 +71,8 @@ QSslCipher::QSslCipher() } /*! + \since 5.3 + Constructs a QSslCipher object for the cipher determined by \a name. The constructor accepts only supported ciphers (i.e., the \a name must identify a cipher in the list of ciphers returned by -- cgit v1.2.3 From 2223d4a368057106443dbe276bbccb5478b8f0a1 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 4 Nov 2015 08:16:57 +0100 Subject: doc: Remove wrong statement about cache filenames. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The cache actually generates paths like "http/data8/f/lr9un1so.d". Change-Id: Ie564494a241c3d1c87b2f0f17b42bd0349948640 Reviewed-by: Jędrzej Nowacki Reviewed-by: Marc Mutz Reviewed-by: Andy Shaw --- src/network/access/qnetworkdiskcache.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/network') diff --git a/src/network/access/qnetworkdiskcache.cpp b/src/network/access/qnetworkdiskcache.cpp index 3f705450dd..1d87d63f5d 100644 --- a/src/network/access/qnetworkdiskcache.cpp +++ b/src/network/access/qnetworkdiskcache.cpp @@ -67,8 +67,7 @@ QT_BEGIN_NAMESPACE QNetworkDiskCache stores each url in its own file inside of the cacheDirectory using QDataStream. Files with a text MimeType - are compressed using qCompress. Each cache file starts with "cache_" - and ends in ".cache". Data is written to disk only in insert() + are compressed using qCompress. Data is written to disk only in insert() and updateMetaData(). Currently you cannot share the same cache files with more than -- cgit v1.2.3 From 6b6955c2ffdb23c461812ffcda12a2296ef58513 Mon Sep 17 00:00:00 2001 From: Alex Trotsenko Date: Wed, 23 Dec 2015 13:10:30 +0200 Subject: QAbstractSocket: do not enable read notifications on TCP in bind() In bind+connect scenario, rejected connection can trigger a read notification while the socket is opened. But unlike UDP, reading from the socket engine or emitting a readyRead() signal is not allowed for the TCP socket in bound or connecting state. To make a bind+connect scenario work properly, disable the read notifications until a connection is established. Task-number: QTBUG-50124 Change-Id: I7b3d015b0f6021fb9ff9f83560478aa5545f41f5 Reviewed-by: Richard J. Moore --- src/network/socket/qabstractsocket.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/network') diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp index 5b1c5fa601..e22c5ccca4 100644 --- a/src/network/socket/qabstractsocket.cpp +++ b/src/network/socket/qabstractsocket.cpp @@ -1530,7 +1530,8 @@ bool QAbstractSocketPrivate::bind(const QHostAddress &address, quint16 port, QAb localPort = socketEngine->localPort(); emit q->stateChanged(state); - socketEngine->setReadNotificationEnabled(true); + if (socketType == QAbstractSocket::UdpSocket) + socketEngine->setReadNotificationEnabled(true); return true; } -- cgit v1.2.3 From 55f0343a99ffd920e2e14ba2bb7669d78224fe42 Mon Sep 17 00:00:00 2001 From: Alex Trotsenko Date: Tue, 8 Dec 2015 16:14:57 +0200 Subject: Do not discard WSAECONNRESET error code from UDP under Windows When a datagram is sent to a closed host/port combination, the host will likely send back an ICMP error message. In the regular socket API, there isn't a good way of actually receiving this error, so some Windows kernels wired that message back up to the call to WSARecvFrom() as a synthetic datagram. Reading this datagram results in a WSAECONNRESET error code, which should reported to the user as a refused connection attempt. To make the errors a bit more informative, the native error strings for WSAECONNRESET and WSAENETRESET were also added. Task-number: QTBUG-49301 Change-Id: If659be54ba1b39965b5f481f0c0cb9eeea0a06d2 Reviewed-by: Oswald Buddenhagen Reviewed-by: Markus Goetz (Woboq GmbH) --- src/network/socket/qnativesocketengine.cpp | 6 ++++++ src/network/socket/qnativesocketengine_p.h | 2 ++ src/network/socket/qnativesocketengine_win.cpp | 12 +++++++++++- 3 files changed, 19 insertions(+), 1 deletion(-) (limited to 'src/network') diff --git a/src/network/socket/qnativesocketengine.cpp b/src/network/socket/qnativesocketengine.cpp index 386e0e2cc7..dfece60036 100644 --- a/src/network/socket/qnativesocketengine.cpp +++ b/src/network/socket/qnativesocketengine.cpp @@ -275,6 +275,12 @@ void QNativeSocketEnginePrivate::setError(QAbstractSocket::SocketError error, Er case TemporaryErrorString: socketErrorString = QNativeSocketEngine::tr("Temporary error"); break; + case NetworkDroppedConnectionErrorString: + socketErrorString = QNativeSocketEngine::tr("Network dropped connection on reset"); + break; + case ConnectionResetErrorString: + socketErrorString = QNativeSocketEngine::tr("Connection reset by peer"); + break; case UnknownSocketErrorString: socketErrorString = QNativeSocketEngine::tr("Unknown error"); break; diff --git a/src/network/socket/qnativesocketengine_p.h b/src/network/socket/qnativesocketengine_p.h index c49ef2c3ad..e540b47069 100644 --- a/src/network/socket/qnativesocketengine_p.h +++ b/src/network/socket/qnativesocketengine_p.h @@ -229,6 +229,8 @@ public: NotSocketErrorString, InvalidProxyTypeString, TemporaryErrorString, + NetworkDroppedConnectionErrorString, + ConnectionResetErrorString, UnknownSocketErrorString = -1 }; diff --git a/src/network/socket/qnativesocketengine_win.cpp b/src/network/socket/qnativesocketengine_win.cpp index 708be2dea7..d673d3a15e 100644 --- a/src/network/socket/qnativesocketengine_win.cpp +++ b/src/network/socket/qnativesocketengine_win.cpp @@ -1250,7 +1250,17 @@ qint64 QNativeSocketEnginePrivate::nativeReceiveDatagram(char *data, qint64 maxL ret = qint64(bytesRead) > maxLength ? maxLength : qint64(bytesRead); } else { WS_ERROR_DEBUG(err); - setError(QAbstractSocket::NetworkError, ReceiveDatagramErrorString); + switch (err) { + case WSAENETRESET: + setError(QAbstractSocket::NetworkError, NetworkDroppedConnectionErrorString); + break; + case WSAECONNRESET: + setError(QAbstractSocket::ConnectionRefusedError, ConnectionResetErrorString); + break; + default: + setError(QAbstractSocket::NetworkError, ReceiveDatagramErrorString); + break; + } ret = -1; } } else { -- cgit v1.2.3 From 294111e25a4e3639a83a87f70ed33ac0b3985f33 Mon Sep 17 00:00:00 2001 From: Alex Trotsenko Date: Sat, 28 Nov 2015 15:27:43 +0200 Subject: QHttpSocketEngine: ensure pending EOF triggers a notification When the remote peer closed the connection, a read notification needs to always be emitted, otherwise the higher layer does not get the disconnected signal. From the other side, underlying QAbstractSocket object could temporarily disable notifications from the engine at any time. To avoid possible blocking of the socket, take a pending EOF into account when the read notifications are re-enabled. Change-Id: Iac9d4e2f790530be3500baf5a2000f1f63df5cc2 Reviewed-by: Ulf Hermann --- src/network/socket/qhttpsocketengine.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/network') diff --git a/src/network/socket/qhttpsocketengine.cpp b/src/network/socket/qhttpsocketengine.cpp index 92ca76b560..a744688f29 100644 --- a/src/network/socket/qhttpsocketengine.cpp +++ b/src/network/socket/qhttpsocketengine.cpp @@ -439,8 +439,11 @@ void QHttpSocketEngine::setReadNotificationEnabled(bool enable) d->readNotificationEnabled = enable; if (enable) { // Enabling read notification can trigger a notification. - if (bytesAvailable()) + if (bytesAvailable()) { slotSocketReadNotification(); + } else if (d->socket && d->socket->state() == QAbstractSocket::UnconnectedState) { + emitReadNotification(); + } } } -- cgit v1.2.3