Merge pull request #1605 from nextcloud/revert-1586-qt5.5-compat

Revert and Fix "Remove HTTP/2 support from Xenial"
This commit is contained in:
Michael Schuster 2019-11-14 03:19:09 +01:00 committed by GitHub
commit d558af31c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 53 deletions

View file

@ -10,55 +10,3 @@
void KMessageWidgetPrivate::createLayout()
{
delete content->layout();
--- b/src/libsync/abstractnetworkjob.cpp
+++ a/src/libsync/abstractnetworkjob.cpp
@@ -160,37 +160,6 @@ void AbstractNetworkJob::slotFinished()
qCWarning(lcNetworkJob) << "SslHandshakeFailedError: " << errorString() << " : can be caused by a webserver wanting SSL client certificates";
}
- // Qt doesn't yet transparently resend HTTP2 requests, do so here
- const auto maxHttp2Resends = 5;
- QByteArray verb = requestVerb(*reply());
- if (_reply->error() == QNetworkReply::ContentReSendError
- && _reply->attribute(QNetworkRequest::HTTP2WasUsedAttribute).toBool()) {
-
- if ((_requestBody && !_requestBody->isSequential()) || verb.isEmpty()) {
- qCWarning(lcNetworkJob) << "Can't resend HTTP2 request, verb or body not suitable"
- << _reply->request().url() << verb << _requestBody;
- } else if (_http2ResendCount >= maxHttp2Resends) {
- qCWarning(lcNetworkJob) << "Not resending HTTP2 request, number of resends exhausted"
- << _reply->request().url() << _http2ResendCount;
- } else {
- qCInfo(lcNetworkJob) << "HTTP2 resending" << _reply->request().url();
- _http2ResendCount++;
-
- resetTimeout();
- if (_requestBody) {
- if(!_requestBody->isOpen())
- _requestBody->open(QIODevice::ReadOnly);
- _requestBody->seek(0);
- }
- sendRequest(
- verb,
- _reply->request().url(),
- _reply->request(),
- _requestBody);
- return;
- }
- }
-
if (_reply->error() != QNetworkReply::NoError) {
if (!_ignoreCredentialFailure || _reply->error() != QNetworkReply::AuthenticationRequiredError) {
qCWarning(lcNetworkJob) << _reply->error() << errorString()
--- b/src/libsync/abstractnetworkjob.h
+++ a/src/libsync/abstractnetworkjob.h
@@ -188,8 +188,7 @@ private:
QPointer<QNetworkReply> _reply; // (QPointer because the NetworkManager may be destroyed before the jobs at exit)
QString _path;
QTimer _timer;
- int _redirectCount = 0;
- int _http2ResendCount = 0;
+ int _redirectCount;
// Set by the xyzRequest() functions and needed to be able to redirect
// requests, should it be required.

View file

@ -160,6 +160,7 @@ void AbstractNetworkJob::slotFinished()
qCWarning(lcNetworkJob) << "SslHandshakeFailedError: " << errorString() << " : can be caused by a webserver wanting SSL client certificates";
}
#if (QT_VERSION >= 0x050800)
// Qt doesn't yet transparently resend HTTP2 requests, do so here
const auto maxHttp2Resends = 5;
QByteArray verb = requestVerb(*reply());
@ -190,6 +191,7 @@ void AbstractNetworkJob::slotFinished()
return;
}
}
#endif
if (_reply->error() != QNetworkReply::NoError) {
if (!_ignoreCredentialFailure || _reply->error() != QNetworkReply::AuthenticationRequiredError) {

View file

@ -189,7 +189,9 @@ private:
QString _path;
QTimer _timer;
int _redirectCount = 0;
#if (QT_VERSION >= 0x050800)
int _http2ResendCount = 0;
#endif
// Set by the xyzRequest() functions and needed to be able to redirect
// requests, should it be required.