summaryrefslogtreecommitdiffstats
path: root/src/network/access/qhttpnetworkconnectionchannel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/access/qhttpnetworkconnectionchannel.cpp')
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp
index a11fc7e807..c86cc9d8c9 100644
--- a/src/network/access/qhttpnetworkconnectionchannel.cpp
+++ b/src/network/access/qhttpnetworkconnectionchannel.cpp
@@ -180,9 +180,7 @@ void QHttpNetworkConnectionChannel::init()
sslSocket->setSslConfiguration(sslConfiguration);
} else {
#endif // !QT_NO_SSL
- if (connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP2)
- protocolHandler.reset(new QHttp2ProtocolHandler(this));
- else
+ if (connection->connectionType() != QHttpNetworkConnection::ConnectionTypeHTTP2)
protocolHandler.reset(new QHttpProtocolHandler(this));
#ifndef QT_NO_SSL
}
@@ -839,6 +837,9 @@ void QHttpNetworkConnectionChannel::_q_connected()
} else {
state = QHttpNetworkConnectionChannel::IdleState;
if (connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP2) {
+ // We have to reset QHttp2ProtocolHandler's state machine, it's a new
+ // connection and the handler's state is unique per connection.
+ protocolHandler.reset(new QHttp2ProtocolHandler(this));
if (spdyRequestsToSend.count() > 0) {
// wait for data from the server first (e.g. initial window, max concurrent requests)
QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection);
@@ -1116,6 +1117,10 @@ void QHttpNetworkConnectionChannel::_q_encrypted()
emitFinishedWithError(QNetworkReply::SslHandshakeFailedError,
"detected unknown Next Protocol Negotiation protocol");
}
+ } else if (connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP2) {
+ // We have to reset QHttp2ProtocolHandler's state machine, it's a new
+ // connection and the handler's state is unique per connection.
+ protocolHandler.reset(new QHttp2ProtocolHandler(this));
}
if (!socket)