Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-61397

HTTP/2: connection to http:// host (that does not support http2) is always failing

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.10.0 Alpha
    • 5.9.0
    • Network: HTTP
    • None
    • 53357f01561d7c2b50e0a656ca250f5e3c1af923

    Description

      When setting the QNetworkRequest::HTTP2AllowedAttribute attribute and connecting to an "http://" url (not https://), the connection fails without recovery.

       

      Example:

      #include <QtNetwork/QtNetwork>
      int main(int argv, char **argc) {
          QCoreApplication app(argv, argc);
          QNetworkAccessManager qnam;
          QObject::connect(&qnam, &QNetworkAccessManager::finished, [&app](QNetworkReply* rep) {
              qDebug() << "RESULT:" << rep->error();
              app.quit();
          });
          QNetworkRequest req(QUrl("http://woboq.com")); // any http url would do
          req.setAttribute(QNetworkRequest::HTTP2AllowedAttribute, true);
          qnam.get(req);
          return app.exec();
      }
      
      /*
       prints:
      
      qt.network.http2: connection error: invalid frame size
      qt.network.http2: stream 1 finished with error: "invalid frame size"
      RESULT: QNetworkReply::NetworkError(ProtocolFailure)
      */
       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            tpochep Timur Pocheptsov
            ogoffart Olivier Goffart (Woboq GmbH)
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes