diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-02-22 19:59:08 +0100 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-02-22 19:59:08 +0100 |
commit | 2a1292b9168d40e71c9e67a41d3b8c499b8e222b (patch) | |
tree | 071014337919d63a62718ea6979fd48775ad61df /tests/auto/network/access | |
parent | 2be7746e0922fa404da567fd0bc0cbc00c6215cb (diff) | |
parent | c204f6e417fe9b10df29e0ba00c7a94e0aa52cef (diff) |
Merge remote-tracking branch 'origin/5.13' into dev
Change-Id: I4b56ce8c76729d9fc60995564299f8f27336fcde
Diffstat (limited to 'tests/auto/network/access')
-rw-r--r-- | tests/auto/network/access/http2/http2srv.cpp | 14 | ||||
-rw-r--r-- | tests/auto/network/access/http2/http2srv.h | 1 | ||||
-rw-r--r-- | tests/auto/network/access/http2/tst_http2.cpp | 2 |
3 files changed, 16 insertions, 1 deletions
diff --git a/tests/auto/network/access/http2/http2srv.cpp b/tests/auto/network/access/http2/http2srv.cpp index 1f9ffb8985..6e2220fa67 100644 --- a/tests/auto/network/access/http2/http2srv.cpp +++ b/tests/auto/network/access/http2/http2srv.cpp @@ -431,6 +431,13 @@ void Http2Server::readReady() if (connectionError) return; + if (redirectSent) { + // We are a "single shot" server, working in 'h2' mode, + // responding with a redirect code. Don't bother to handle + // anything else now. + return; + } + if (upgradeProtocol) { handleProtocolUpgrade(); } else if (waitingClientPreface) { @@ -800,6 +807,13 @@ void Http2Server::sendResponse(quint32 streamID, bool emptyBody) HttpHeader header; if (redirectWhileReading) { + if (redirectSent) { + // This is a "single-shot" server responding with a redirect code. + return; + } + + redirectSent = true; + qDebug("server received HEADERS frame (followed by DATA frames), redirecting ..."); Q_ASSERT(targetPort); header.push_back({":status", "308"}); diff --git a/tests/auto/network/access/http2/http2srv.h b/tests/auto/network/access/http2/http2srv.h index 87a17ced8b..ae3f084fdc 100644 --- a/tests/auto/network/access/http2/http2srv.h +++ b/tests/auto/network/access/http2/http2srv.h @@ -193,6 +193,7 @@ private: // Redirect, with status code 308, as soon as we've seen headers, while client // may still be sending DATA frames. See tst_Http2::earlyResponse(). bool redirectWhileReading = false; + bool redirectSent = false; quint16 targetPort = 0; QAtomicInt interrupted; protected slots: diff --git a/tests/auto/network/access/http2/tst_http2.cpp b/tests/auto/network/access/http2/tst_http2.cpp index bbb314128b..02c5e51cbe 100644 --- a/tests/auto/network/access/http2/tst_http2.cpp +++ b/tests/auto/network/access/http2/tst_http2.cpp @@ -474,7 +474,7 @@ void tst_Http2::earlyResponse() runEventLoop(); QVERIFY(serverPort); - sendRequest(1, QNetworkRequest::NormalPriority, {10000000, Qt::Uninitialized}); + sendRequest(1, QNetworkRequest::NormalPriority, {1000000, Qt::Uninitialized}); runEventLoop(); |