Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.5.2
-
13c4e11c4 (dev), 44e53b3ed (6.6), 3e1cf8b0a (6.5), 545d6e52d (tqtc/lts-6.2)
Description
Please see the code below. Multiple requests of QNetworkAccessManager together to a single URL, where the first two are stopped, but the last one never completes. If you call abort the final one does complete. but there is a workaground , if setting the property of QNetworkRequest object like setAttribute(QNetworkRequest::Http2AllowedAttribute, false); then it works fine.
#include <QCoreApplication> #include <QNetworkAccessManager> #include <QNetworkReply> #include <QTimer> namespace { void watch(QNetworkReply *reply, const QString &name) { QObject::connect(reply, &QNetworkReply::finished, [=]() { qInfo() << name << ": finished"; }); QObject::connect(reply, &QNetworkReply::destroyed, [=]() { qInfo() << name << ": destroyed"; }); } void abort(QNetworkReply *reply) { //reply->abort(); // if you do this it works //reply->close(); // if you do this it still does not work reply->deleteLater(); } } int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); QNetworkAccessManager manager; QTimer::singleShot(1, [&]() { { auto reply = manager.get(QNetworkRequest(QUrl("https://www.google.com/"))); watch(reply, "dud1"); abort(reply); } { auto reply = manager.get(QNetworkRequest(QUrl("https://www.google.com/"))); watch(reply, "dud2"); abort(reply); } { auto reply = manager.get(QNetworkRequest(QUrl("https://www.google.com/"))); watch(reply, "real"); } }); return a.exec(); }
Attachments
For Gerrit Dashboard: QTBUG-116167 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
509481,13 | http2: When a reply is removed from the queue, only remove one | dev | qt/qtbase | Status: MERGED | +2 | 0 |
512030,2 | http2: When a reply is removed from the queue, only remove one | 6.6 | qt/qtbase | Status: MERGED | +2 | 0 |
512402,2 | http2: When a reply is removed from the queue, only remove one | 6.5 | qt/qtbase | Status: MERGED | +2 | 0 |
512518,4 | http2: When a reply is removed from the queue, only remove one | tqtc/lts-6.2 | qt/tqtc-qtbase | Status: MERGED | +2 | 0 |