summaryrefslogtreecommitdiffstats
path: root/src/network/access/qhttpnetworkconnection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/access/qhttpnetworkconnection.cpp')
-rw-r--r--src/network/access/qhttpnetworkconnection.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp
index 79f418f675..8e5cfd9497 100644
--- a/src/network/access/qhttpnetworkconnection.cpp
+++ b/src/network/access/qhttpnetworkconnection.cpp
@@ -60,6 +60,7 @@
# include <QtNetwork/qsslkey.h>
# include <QtNetwork/qsslcipher.h>
# include <QtNetwork/qsslconfiguration.h>
+# include <QtNetwork/qsslerror.h>
#endif
@@ -82,9 +83,10 @@ QHttpNetworkConnectionPrivate::QHttpNetworkConnectionPrivate(const QString &host
networkLayerState(Unknown),
hostName(hostName), port(port), encrypt(encrypt), delayIpv4(true)
#ifndef QT_NO_SSL
-, channelCount((type == QHttpNetworkConnection::ConnectionTypeSPDY) ? 1 : defaultHttpChannelCount)
+, channelCount((type == QHttpNetworkConnection::ConnectionTypeSPDY || type == QHttpNetworkConnection::ConnectionTypeHTTP2)
+ ? 1 : defaultHttpChannelCount)
#else
-, channelCount(defaultHttpChannelCount)
+, channelCount(type == QHttpNetworkConnection::ConnectionTypeHTTP2 ? 1 : defaultHttpChannelCount)
#endif // QT_NO_SSL
#ifndef QT_NO_NETWORKPROXY
, networkProxy(QNetworkProxy::NoProxy)
@@ -317,9 +319,9 @@ void QHttpNetworkConnectionPrivate::prepareRequest(HttpMessagePair &messagePair)
if (systemLocale == QLatin1String("C"))
acceptLanguage = QString::fromLatin1("en,*");
else if (systemLocale.startsWith(QLatin1String("en-")))
- acceptLanguage = QString::fromLatin1("%1,*").arg(systemLocale);
+ acceptLanguage = systemLocale + QLatin1String(",*");
else
- acceptLanguage = QString::fromLatin1("%1,en,*").arg(systemLocale);
+ acceptLanguage = systemLocale + QLatin1String(",en,*");
request.setHeaderField("Accept-Language", acceptLanguage.toLatin1());
}
@@ -617,13 +619,11 @@ QHttpNetworkReply* QHttpNetworkConnectionPrivate::queueRequest(const QHttpNetwor
break;
}
}
-#ifndef QT_NO_SSL
- else { // SPDY
+ else { // SPDY, HTTP/2
if (!pair.second->d_func()->requestIsPrepared)
prepareRequest(pair);
channels[0].spdyRequestsToSend.insertMulti(request.priority(), pair);
}
-#endif // QT_NO_SSL
// For Happy Eyeballs the networkLayerState is set to Unknown
// untill we have started the first connection attempt. So no
@@ -1011,8 +1011,9 @@ void QHttpNetworkConnectionPrivate::_q_startNextRequest()
}
break;
}
+ case QHttpNetworkConnection::ConnectionTypeHTTP2:
case QHttpNetworkConnection::ConnectionTypeSPDY: {
-#ifndef QT_NO_SSL
+
if (channels[0].spdyRequestsToSend.isEmpty())
return;
@@ -1024,7 +1025,6 @@ void QHttpNetworkConnectionPrivate::_q_startNextRequest()
if (channels[0].socket && channels[0].socket->state() == QAbstractSocket::ConnectedState
&& !channels[0].pendingEncrypt)
channels[0].sendRequest();
-#endif // QT_NO_SSL
break;
}
}