diff options
author | Timur Pocheptsov <timur.pocheptsov@theqtcompany.com> | 2016-08-04 09:34:50 +0200 |
---|---|---|
committer | Timur Pocheptsov <timur.pocheptsov@theqtcompany.com> | 2016-08-04 10:21:24 +0000 |
commit | 2d1f1371733c85b23eb91d27999c5a0ec9373a54 (patch) | |
tree | 0789ab06c9d0ec125b7e989109a8a163982970a6 /src/network/access/qhttpnetworkconnectionchannel.cpp | |
parent | 4a40c717f3cf1ae181df49c91261a12d5e33e5a4 (diff) |
Revert "Implement protocol upgrade for HTTP/2 enabled requests"
This reverts commit 12d71f4ea20415ff2274e1e90f9e4d5a8b935d7f.
This change is breaking a build + incomplete as my test revealed.
Will have to re-try later.
Change-Id: I7ea089093a832aa5822caaaac56e62f5fda4df17
Reviewed-by: Liang Qi <liang.qi@qt.io>
Diffstat (limited to 'src/network/access/qhttpnetworkconnectionchannel.cpp')
-rw-r--r-- | src/network/access/qhttpnetworkconnectionchannel.cpp | 40 |
1 files changed, 8 insertions, 32 deletions
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp index 3d35fe5f04..3a780f636b 100644 --- a/src/network/access/qhttpnetworkconnectionchannel.cpp +++ b/src/network/access/qhttpnetworkconnectionchannel.cpp @@ -50,7 +50,6 @@ #include <private/qhttp2protocolhandler_p.h> #include <private/qhttpprotocolhandler_p.h> #include <private/qspdyprotocolhandler_p.h> -#include <private/http2protocol_p.h> #ifndef QT_NO_SSL # include <private/qsslsocket_p.h> @@ -181,9 +180,6 @@ void QHttpNetworkConnectionChannel::init() sslSocket->setSslConfiguration(sslConfiguration); } else { #endif // QT_NO_SSL - // Even if connection->connectionType is ConnectionTypeHTTP2, - // we first start as HTTP/1.1, asking for a protocol upgrade - // in the first response. protocolHandler.reset(new QHttpProtocolHandler(this)); #ifndef QT_NO_SSL } @@ -839,16 +835,6 @@ void QHttpNetworkConnectionChannel::_q_connected() #endif } else { state = QHttpNetworkConnectionChannel::IdleState; - if (connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP2) { - Q_ASSERT(spdyRequestsToSend.size()); - auto it = spdyRequestsToSend.begin(); - // Let's inject some magic fields, requesting a protocol upgrade: - Http2::qt_add_ProtocolUpgradeRequest(it->first); - connection->d_func()->requeueRequest(*it); - // Remove it, we never send it again as HTTP/2. - spdyRequestsToSend.erase(it); - } - if (!reply) connection->d_func()->dequeueRequest(socket); if (reply) @@ -986,12 +972,9 @@ void QHttpNetworkConnectionChannel::_q_error(QAbstractSocket::SocketError socket } } while (!connection->d_func()->highPriorityQueue.isEmpty() || !connection->d_func()->lowPriorityQueue.isEmpty()); - - if (connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP2 #ifndef QT_NO_SSL - || connection->connectionType() == QHttpNetworkConnection::ConnectionTypeSPDY -#endif - ) { + if (connection->connectionType() == QHttpNetworkConnection::ConnectionTypeSPDY || + connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP2) { QList<HttpMessagePair> spdyPairs = spdyRequestsToSend.values(); for (int a = 0; a < spdyPairs.count(); ++a) { // emit error for all replies @@ -1000,6 +983,7 @@ void QHttpNetworkConnectionChannel::_q_error(QAbstractSocket::SocketError socket emit currentReply->finishedWithError(errorCode, errorString); } } +#endif // QT_NO_SSL // send the next request QMetaObject::invokeMethod(that, "_q_startNextRequest", Qt::QueuedConnection); @@ -1018,31 +1002,23 @@ void QHttpNetworkConnectionChannel::_q_error(QAbstractSocket::SocketError socket } } -void QHttpNetworkConnectionChannel::_q_protocolSwitch() -{ - Q_ASSERT(connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP2); - Q_ASSERT(reply); - Q_ASSERT(reply->statusCode() == 101); - protocolHandler.reset(new QHttp2ProtocolHandler(this, HttpMessagePair(request, reply))); - protocolHandler->_q_receiveReply(); -} - #ifndef QT_NO_NETWORKPROXY void QHttpNetworkConnectionChannel::_q_proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator* auth) { - if (connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP2 #ifndef QT_NO_SSL - || connection->connectionType() == QHttpNetworkConnection::ConnectionTypeSPDY -#endif - ) { + if (connection->connectionType() == QHttpNetworkConnection::ConnectionTypeSPDY || + connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP2) { connection->d_func()->emitProxyAuthenticationRequired(this, proxy, auth); } else { // HTTP +#endif // QT_NO_SSL // Need to dequeue the request before we can emit the error. if (!reply) connection->d_func()->dequeueRequest(socket); if (reply) connection->d_func()->emitProxyAuthenticationRequired(this, proxy, auth); +#ifndef QT_NO_SSL } +#endif // QT_NO_SSL } #endif |