summaryrefslogtreecommitdiffstats
path: root/src/network/access/qhttpnetworkconnectionchannel.cpp
diff options
context:
space:
mode:
authorTimur Pocheptsov <timur.pocheptsov@qt.io>2020-04-06 11:12:55 +0200
committerTimur Pocheptsov <timur.pocheptsov@qt.io>2020-04-07 16:46:44 +0200
commit603eaa9fbb250ce1f4ec5a5a9750a115ef08a956 (patch)
tree044ab63c302fc211dc376418882043a7387359a5 /src/network/access/qhttpnetworkconnectionchannel.cpp
parent2d0c7d3d9e0f88fe2328eab04372a7efbf9b29cb (diff)
H2C - make sure we send the client preface and settings
It's required as a response to upgraded protocol and apparently some servers would wait for it, not sending any frames. Becomes a problem in case only one request was sent. Fixes: QTBUG-83312 Change-Id: I90dc5c04095f0b78baa404466625d329dc4c6e21 Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/network/access/qhttpnetworkconnectionchannel.cpp')
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp
index 319c4953b1..95850efe36 100644
--- a/src/network/access/qhttpnetworkconnectionchannel.cpp
+++ b/src/network/access/qhttpnetworkconnectionchannel.cpp
@@ -488,6 +488,9 @@ void QHttpNetworkConnectionChannel::allDone()
QHttp2ProtocolHandler *h2c = static_cast<QHttp2ProtocolHandler *>(protocolHandler.data());
QMetaObject::invokeMethod(h2c, "_q_receiveReply", Qt::QueuedConnection);
QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection);
+ // If we only had one request sent with H2 allowed, we may fail to send
+ // a client preface and SETTINGS, which is required by RFC 7540, 3.2.
+ QMetaObject::invokeMethod(h2c, "ensureClientPrefaceSent", Qt::QueuedConnection);
return;
} else {
// Ok, whatever happened, we do not try HTTP/2 anymore ...