Skip to content

Commit

Permalink
HTTP2: Only from Qt 5.10.0 #6285
Browse files Browse the repository at this point in the history
  • Loading branch information
guruz committed Feb 12, 2018
1 parent 7eb2dc2 commit 5c754b8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ version 2.4.1 (2017-02-xx)
* Avatars: Use old location for servers <10 (#6279)
* Link shares: Change default share name (#6298)
* Nautilus integration: Work with python2 and python3
* HTTP2: Only allow with Qt 5.10.0 (#6285)
* Crash fixes

version 2.4.0 (2017-12-21)
Expand Down
4 changes: 2 additions & 2 deletions src/libsync/accessmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ QNetworkReply *AccessManager::createRequest(QNetworkAccessManager::Operation op,
qInfo(lcAccessManager) << op << verb << newRequest.url().toString() << "has X-Request-ID" << requestId;
newRequest.setRawHeader("X-Request-ID", requestId);

#if QT_VERSION >= QT_VERSION_CHECK(5, 9, 0)
// only enable HTTP2 with Qt 5.9 because Qt 5.8.0 has too many bugs
#if QT_VERSION >= QT_VERSION_CHECK(5, 9, 4)
// only enable HTTP2 with Qt 5.9.4 because old Qt have too many bugs (e.g. QTBUG-64359 is fixed in >= Qt 5.9.4)
// (only use one connection if the server does not support HTTP2)
if (newRequest.url().scheme() == "https") { // Not for "http": QTBUG-61397
newRequest.setAttribute(QNetworkRequest::HTTP2AllowedAttribute, true);
Expand Down
3 changes: 2 additions & 1 deletion src/libsync/connectionvalidator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,9 @@ bool ConnectionValidator::setAndCheckServerVersion(const QString &version)
// We attempt to work with servers >= 5.0.0 but warn users.
// Check usages of Account::serverVersionUnsupported() for details.

#if QT_VERSION >= QT_VERSION_CHECK(5, 9, 0)
#if QT_VERSION >= QT_VERSION_CHECK(5, 9, 4)
// Record that the server supports HTTP/2
// QTBUG-64359 is fixed in >= Qt 5.9.4
if (auto job = qobject_cast<AbstractNetworkJob *>(sender())) {
if (auto reply = job->reply()) {
_account->setHttp2Supported(
Expand Down

0 comments on commit 5c754b8

Please sign in to comment.