From be05bb749ee5a0b124ef7b4fcf8e92b29de2eeb7 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Wed, 8 Sep 2021 09:46:29 +0200 Subject: QNetworkAccessManager: Configurable number of HTTP1 TCP connections MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Introduces new class QHttp1Configuration. [ChangeLog][QtNetwork][QHttp1Configuration] New class. Fixes: QTBUG-25280 Fixes: QTBUG-108215 Change-Id: Ide6cee23946e5001befb8fab34edf10b8a66e02b Reviewed-by: MÃ¥rten Nordheim --- src/network/access/qnetworkrequest.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/network/access/qnetworkrequest.cpp') diff --git a/src/network/access/qnetworkrequest.cpp b/src/network/access/qnetworkrequest.cpp index 238ed2eddaf..6e771f6bc77 100644 --- a/src/network/access/qnetworkrequest.cpp +++ b/src/network/access/qnetworkrequest.cpp @@ -7,6 +7,7 @@ #include "qnetworkcookie.h" #include "qsslconfiguration.h" #if QT_CONFIG(http) || defined(Q_QDOC) +#include "qhttp1configuration.h" #include "qhttp2configuration.h" #include "private/http2protocol_p.h" #endif @@ -439,6 +440,7 @@ public: #endif peerVerifyName = other.peerVerifyName; #if QT_CONFIG(http) + h1Configuration = other.h1Configuration; h2Configuration = other.h2Configuration; decompressedSafetyCheckThreshold = other.decompressedSafetyCheckThreshold; #endif @@ -454,6 +456,7 @@ public: maxRedirectsAllowed == other.maxRedirectsAllowed && peerVerifyName == other.peerVerifyName #if QT_CONFIG(http) + && h1Configuration == other.h1Configuration && h2Configuration == other.h2Configuration && decompressedSafetyCheckThreshold == other.decompressedSafetyCheckThreshold #endif @@ -470,6 +473,7 @@ public: int maxRedirectsAllowed; QString peerVerifyName; #if QT_CONFIG(http) + QHttp1Configuration h1Configuration; QHttp2Configuration h2Configuration; qint64 decompressedSafetyCheckThreshold = 10ll * 1024ll * 1024ll; #endif @@ -854,6 +858,30 @@ void QNetworkRequest::setPeerVerifyName(const QString &peerName) } #if QT_CONFIG(http) || defined(Q_QDOC) +/*! + \since 6.5 + + Returns the current parameters that QNetworkAccessManager is + using for the underlying HTTP/1 connection of this request. + + \sa setHttp1Configuration +*/ +QHttp1Configuration QNetworkRequest::http1Configuration() const +{ + return d->h1Configuration; +} +/*! + \since 6.5 + + Sets request's HTTP/1 parameters from \a configuration. + + \sa http1Configuration, QNetworkAccessManager, QHttp1Configuration +*/ +void QNetworkRequest::setHttp1Configuration(const QHttp1Configuration &configuration) +{ + d->h1Configuration = configuration; +} + /*! \since 5.14 -- cgit v1.2.3