summaryrefslogtreecommitdiffstats
path: root/tests/auto/network/access/http2/tst_http2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/network/access/http2/tst_http2.cpp')
-rw-r--r--tests/auto/network/access/http2/tst_http2.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/auto/network/access/http2/tst_http2.cpp b/tests/auto/network/access/http2/tst_http2.cpp
index d7a57f5e26..9befb7276e 100644
--- a/tests/auto/network/access/http2/tst_http2.cpp
+++ b/tests/auto/network/access/http2/tst_http2.cpp
@@ -47,10 +47,12 @@
#include <cstdlib>
#include <string>
-// At the moment our HTTP/2 imlpementation requires ALPN and this means OpenSSL.
#if !defined(QT_NO_OPENSSL) && OPENSSL_VERSION_NUMBER >= 0x10002000L && !defined(OPENSSL_NO_TLSEXT)
+// HTTP/2 over TLS requires ALPN/NPN to negotiate the protocol version.
const bool clearTextHTTP2 = false;
#else
+// No ALPN/NPN support to negotiate HTTP/2, we'll use cleartext 'h2c' with
+// a protocol upgrade procedure.
const bool clearTextHTTP2 = true;
#endif
@@ -122,6 +124,7 @@ private:
const Http2Settings tst_Http2::defaultServerSettings{{Http2::Settings::MAX_CONCURRENT_STREAMS_ID, 100}};
const Http2Settings tst_Http2::defaultClientSettings{{Http2::Settings::MAX_FRAME_SIZE_ID, quint32(Http2::maxFrameSize)},
+ {Http2::Settings::INITIAL_WINDOW_SIZE_ID, quint32(Http2::initialStreamReceiveWindowSize)},
{Http2::Settings::ENABLE_PUSH_ID, quint32(0)}};
namespace {
@@ -272,7 +275,7 @@ void tst_Http2::flowControlClientSide()
ServerPtr srv(newServer(serverSettings));
- const QByteArray respond(int(Http2::defaultSessionWindowSize * 50), 'x');
+ const QByteArray respond(int(Http2::initialStreamReceiveWindowSize * 5), 'x');
srv->setResponseBody(respond);
QMetaObject::invokeMethod(srv.data(), "startServer", Qt::QueuedConnection);
@@ -340,6 +343,7 @@ void tst_Http2::pushPromise()
const EnvVarGuard env("QT_HTTP2_ENABLE_PUSH_PROMISE", "1");
const Http2Settings clientSettings{{Settings::MAX_FRAME_SIZE_ID, quint32(Http2::maxFrameSize)},
+ {Http2::Settings::INITIAL_WINDOW_SIZE_ID, quint32(Http2::initialStreamReceiveWindowSize)},
{Settings::ENABLE_PUSH_ID, quint32(1)}};
ServerPtr srv(newServer(defaultServerSettings, clientSettings));
@@ -507,6 +511,7 @@ void tst_Http2::sendRequest(int streamNumber,
QNetworkRequest request(url);
request.setAttribute(QNetworkRequest::HTTP2AllowedAttribute, QVariant(true));
+ request.setHeader(QNetworkRequest::ContentTypeHeader, QVariant("text/plain"));
request.setPriority(priority);
QNetworkReply *reply = nullptr;