diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2014-02-28 13:13:16 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2014-02-28 13:14:15 +0100 |
commit | 846cc4c75cc06def67e831c8cb3c9edaef24f8f0 (patch) | |
tree | cf8cd76a5a610a6264583148b2c0549f7514dde3 /src/network/access/qnetworkaccessmanager.cpp | |
parent | 9e4a215a2569a04010292c8718d0f0569bc06c12 (diff) | |
parent | 0d0fb04d505d105fb4b2fc71d68f729ce670b12e (diff) |
Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
src/network/access/qhttpthreaddelegate.cpp
Change-Id: Ia15372687c93cd585967b006c0baaac3a5f29e91
Diffstat (limited to 'src/network/access/qnetworkaccessmanager.cpp')
-rw-r--r-- | src/network/access/qnetworkaccessmanager.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp index c89419091f..473acc5f22 100644 --- a/src/network/access/qnetworkaccessmanager.cpp +++ b/src/network/access/qnetworkaccessmanager.cpp @@ -977,6 +977,12 @@ QNetworkAccessManager::NetworkAccessibility QNetworkAccessManager::networkAccess \a sslConfiguration. This function is useful to complete the TCP and SSL handshake to a host before the HTTPS request is made, resulting in a lower network latency. + \note Preconnecting a SPDY connection can be done by calling setAllowedNextProtocols() + on \a sslConfiguration with QSslConfiguration::NextProtocolSpdy3_0 contained in + the list of allowed protocols. When using SPDY, one single connection per host is + enough, i.e. calling this method multiple times per host will not result in faster + network transactions. + \note This function has no possibility to report errors. \sa connectToHost(), get(), post(), put(), deleteResource() @@ -991,6 +997,13 @@ void QNetworkAccessManager::connectToHostEncrypted(const QString &hostName, quin QNetworkRequest request(url); if (sslConfiguration != QSslConfiguration::defaultConfiguration()) request.setSslConfiguration(sslConfiguration); + + // There is no way to enable SPDY via a request, so we need to check + // the ssl configuration whether SPDY is allowed here. + if (sslConfiguration.allowedNextProtocols().contains( + QSslConfiguration::NextProtocolSpdy3_0)) + request.setAttribute(QNetworkRequest::SpdyAllowedAttribute, true); + get(request); } #endif |