summaryrefslogtreecommitdiffstats
path: root/src/network/access/qnetworkrequest.cpp
diff options
context:
space:
mode:
authorMarkus Goetz <[email protected]>2021-09-08 09:46:29 +0200
committerMarc Mutz <[email protected]>2022-12-09 02:40:12 +0000
commitbe05bb749ee5a0b124ef7b4fcf8e92b29de2eeb7 (patch)
treecde5a900748b63adbd01f3c2b6deb43fcc7ac65e /src/network/access/qnetworkrequest.cpp
parenta09c33e1f7b5999a16bce9dd23ef8ca33d519210 (diff)
QNetworkAccessManager: Configurable number of HTTP1 TCP connections
Introduces new class QHttp1Configuration. [ChangeLog][QtNetwork][QHttp1Configuration] New class. Fixes: QTBUG-25280 Fixes: QTBUG-108215 Change-Id: Ide6cee23946e5001befb8fab34edf10b8a66e02b Reviewed-by: MÃ¥rten Nordheim <[email protected]>
Diffstat (limited to 'src/network/access/qnetworkrequest.cpp')
-rw-r--r--src/network/access/qnetworkrequest.cpp28
1 files changed, 28 insertions, 0 deletions
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
@@ -855,6 +859,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
Returns the current parameters that QNetworkAccessManager is