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

REST helpers 6.7 remaining miscellaneous

    XMLWordPrintable

Details

    • Task
    • Resolution: Fixed
    • P2: Important
    • None
    • 6.7.0 FF
    • Network
    • None
    • All
    • 21
    • 11b19b334 (dev), 0bfec6cd1 (dev), ec98afd19 (dev), 4da14a67a (dev), 1702a37a3 (dev), 980b57e85 (6.7), 7c0600836 (6.7), b7e793f62 (6.7), f75766248 (dev), 9f6e20a5f (6.7)
    • Foundations Sprint 95, Foundations Sprint 96, Foundations Sprint 97, Foundations Sprint 98, Foundations Sprint 99, Foundation Sprint 100

    Description

      Few remaining tasks in Qt 6.7 scope, likely post-FF. This ticket covers also the remaining items for QHttpHeader and adding std::chrono support for QNetworkAccessManager&QNetworkRequest classes.

      Must:

      • TP marking of classes QRestAccessManager, QRestReply, Q<x>RequestProvider (subject to renaming still) Done
      • Autotest memory leaks if a cases fail (reply pointers) (see related abandoned task)
      • Rewrite of the QRestReply internal charset parser Will be done with QTBUG-120307
      • Grammatical fixing and fine-tuning of documentation Will be done with QTBUG-120028

      Should:

      • Setter QRestAccessManager::setNetworkAccessManager() Done (constructor setter), both QRestAM and QRestReply are now non-owning
      • Empty QHttpHeaders not to allocate dynamic memory on instantiation Done
      • Union/variant the header names for faster lookups (specifically, to store all WellKnownHeaders names as enums, not strings) Will be done with a separate task (see the comment)
      • reserve() before looping over append() in QHttpHeader ctors that bring in data Done
      • ditto toX() functions, where applicable Done
      • Streaming chunking QStringEncoder to support reading text() without waiting for reply to complete. Could be useful at least with Server-Side Events (SSE), a setup where server streams UTF-8 text events Done
      • Use qxp::function_ref instead of Functor in private API? Will be done with a separate task (see the comment)
      • inline old int overloads of chrono functions. Will be done with a separate task (see the comment)
      • reconsider if the QRestReply json() should return a QJsonDocument instead Done
      • optimize the QRAM QVariantMap overloads to not create a QJsonDocument first, but serialize directly. Will be done with a separate task (see the comment)

      Maybe/could:

      • Do value trimming on view already Will be done with a separate task (see the comment)
      • HTTP OPTIONS QRestAccessManager::options() function (bodyless). CORS not very important use case though (browserless native apps), but could be useful for server-side API reflection Can be possibly added later, but for the time being doesn't seem high priority
      • Enum for setBearerToken() which specifies the location of bearerToken (header, body, url). However header is the most widely adopted and secure, so probably no need Wont do for the reason mentioned
      • Support for deleting QRestReply replies in handler without deleteLater(). Could complicate matters more than the benefits though Wont do for the reason mentioned
      • QHttpHeaders::serializeTo(), wrapping https://codereview.qt-project.org/c/qt/qtbase/+/489845/46/tests/auto/network/access/qrestaccessmanager/httptestserver.cpp#85 with some options and target types (QIODevice, QByteArray, ...)
      • Add QHttpHeaders::reserve(qsizetype) to reserve underlying storage? Done (part of API review tasks)
      • Comparison in headerNameIs creates a qbytearray copy, which potentially could be avoided Will be done with a separate task (see the comment)

      Attachments

        Issue Links

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

          Activity

            People

              vuokko Juha Vuolle
              vuokko Juha Vuolle
              Vladimir Minenko Vladimir Minenko
              Alex Blasche Alex Blasche
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: