diff options
author | Mårten Nordheim <marten.nordheim@qt.io> | 2021-11-26 13:15:46 +0100 |
---|---|---|
committer | Mårten Nordheim <marten.nordheim@qt.io> | 2021-12-04 08:20:52 +0000 |
commit | 9909ec0bc63325fc115d9d84ab01c08333fd8c53 (patch) | |
tree | 82ed9aaaddcbb11315439d51c3409b67676f3154 /src/network/access/qnetworkrequest.cpp | |
parent | 5074344c9c1fb9a510f333d470d83e8da94072f9 (diff) |
QNAM: Reintroduce h2c with an attribute
[ChangeLog][QtNetwork][QNetworkRequest] Added
QNetworkRequest::Http2CleartextAllowedAttribute which controls whether
HTTP/2 cleartext (h2c) is allowed or not. The default is false. This
replaces the QT_NETWORK_H2C_ALLOWED environment variable.
Task-number: QTBUG-98642
Change-Id: I43ae1cc671788f6d2559cd316f6667b412c8e75e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/network/access/qnetworkrequest.cpp')
-rw-r--r-- | src/network/access/qnetworkrequest.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/network/access/qnetworkrequest.cpp b/src/network/access/qnetworkrequest.cpp index 3e9c12ae9e..64d35aa278 100644 --- a/src/network/access/qnetworkrequest.cpp +++ b/src/network/access/qnetworkrequest.cpp @@ -272,7 +272,8 @@ QT_BEGIN_NAMESPACE Requests only, type: QMetaType::Bool (default: true) Indicates whether the QNetworkAccessManager code is allowed to use HTTP/2 with this request. This applies - to SSL requests or 'cleartext' HTTP/2. + to SSL requests or 'cleartext' HTTP/2 if Http2CleartextAllowedAttribute + is set. \value Http2WasUsedAttribute Replies only, type: QMetaType::Bool (default: false) @@ -304,8 +305,9 @@ QT_BEGIN_NAMESPACE If set, this attribute will force QNetworkAccessManager to use HTTP/2 protocol without initial HTTP/2 protocol negotiation. Use of this attribute implies prior knowledge that a particular - server supports HTTP/2. The attribute works with SSL or 'cleartext' - HTTP/2. If a server turns out to not support HTTP/2, when HTTP/2 direct + server supports HTTP/2. The attribute works with SSL or with 'cleartext' + HTTP/2 if Http2CleartextAllowedAttribute is set. + If a server turns out to not support HTTP/2, when HTTP/2 direct was specified, QNetworkAccessManager gives up, without attempting to fall back to HTTP/1.1. If both Http2AllowedAttribute and Http2DirectAttribute are set, Http2DirectAttribute takes priority. @@ -325,6 +327,15 @@ QT_BEGIN_NAMESPACE be closed after the last pending request had been processed. (This value was introduced in 6.3.) + \value Http2CleartextAllowedAttribute + Requests only, type: QMetaType::Bool (default: false) + If set, this attribute will tell QNetworkAccessManager to attempt + an upgrade to HTTP/2 over cleartext (also known as h2c). + Until Qt 7 the default value for this attribute can be overridden + to true by setting the QT_NETWORK_H2C_ALLOWED environment variable. + This attribute is ignored if the Http2AllowedAttribute is not set. + (This value was introduced in 6.3.) + \value User Special type. Additional information can be passed in QVariants with types ranging from User to UserMax. The default |