Commit Graph

3702 Commits (2d2fae48637d0aaa77cdd7dd413c40efec27a8a5)

Author SHA1 Message Date
Marc Mutz 96f78cbdd9 qrestreply_p.h: include what you need
QStringDecoder within std::optional needs QStringDecoder to be fully
defined ("in-size" (Lakos)).

QByteArray, used as a function parameter, can be forward-declard,
though ("in-name-only" (Lakos)).

This also makes the header comply with Qt's private symbol versioning,
which requires every private header to include some other private
header, or, eventually, qglobal_p.h.

Amends 4da14a67a6.

Pick-to: 6.7
Change-Id: I35fed05955f1194299162b576834c1045672bcac
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-04-18 19:06:01 +02:00
Marc Mutz 063e31209b QRestReply: micro-optimize optional<QStringDecoder> handling
Use optional::emplace() instead of assignment from an rvalue.

Saves the move constructor and destructor calls, both of which are not
trivial (due to cleanFn).

Pick-to: 6.7
Change-Id: Ief77626c77d0c8c2ce17e3b1a21496a7da969761
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
2024-04-18 11:31:00 +02:00
Tor Arne Vestbø d5bf42f75b Add preliminary support for Qt for visionOS
Qt already runs on Vision Pro as "Designed for iPad", using Qt
for iOS. This change enables building Qt for visionOS directly,
which opens the door to visionOS specific APIs and use-cases
such as volumes and immersive spaces.

The platform removes some APIs we depend on, notably UIScreen,
so some code paths have been disabled or mocked to get something
up and running.

As our current window management approach on UIKit platforms
depends on UIWindow and UIScreen there is currently no way to
bring up QWindows. This will improve once we refactor our
window management to use window scenes.

To configure for visionOS, pass -platform macx-visionos-clang,
and optionally add -sdk xrsimulator to build for the simulator.

Change-Id: I4eda55fc3fd06e12d30a188928487cf68940ee07
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-04-18 05:00:57 +02:00
Mårten Nordheim d5d9317c31 QHttpNetworkConnectionPrivate: mark NO_COPY_MOVE
To get clang-tidy to stop complaining about missing
copy/move-ctor/assign

Task-number: QTBUG-102855
Change-Id: Iefc19da324090db3a38d017859ad0a32ae7d6ff5
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-04-17 20:30:37 +02:00
Mårten Nordheim 60ff037364 QHttpNetworkConnectionPrivate: reflow ctor
Task-number: QTBUG-102855
Change-Id: Idcb67b434f9f627a408d730d9cec8d749094728e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-04-17 20:30:36 +02:00
Mårten Nordheim c9e6cdc19e QHttpNetworkConnectionPrivate: NSDMI
Initialize the hardcoded things inside the class.

Task-number: QTBUG-102855
Change-Id: I06da0a615ec066e63d9cd0359313e8e8f588718e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-04-17 20:30:36 +02:00
Mårten Nordheim 28bff27b85 QHttpNetworkConnectionPrivate: move some init logic into a function
Now we can nicely initialize it as a member-initializer.
Do channels at the same time, NSDMI follows.

Task-number: QTBUG-102855
Change-Id: I59c1fe044687500ed3a9d5878c6e4fc137114542
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-04-17 20:30:36 +02:00
Mårten Nordheim e88a2ed83b QHttpNetworkConnectionPrivate: fix clang-tidy mismatching argument
It complains about the declaration arg. name differing from the definition name

Task-number: QTBUG-102855
Change-Id: I005ab69b0f41db0bda3ef64f2c779c3cb3f6fd38
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-04-17 20:30:36 +02:00
Mårten Nordheim 791455c039 QHttpNetworkConnection: Remove redundant/unused ctor
Task-number: QTBUG-102855
Change-Id: Ifcd25c241f2e331b0c271d3462b5a2896797d101
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2024-04-17 20:30:36 +02:00
Mårten Nordheim b85acc8356 tst_QHttpNetworkConnection: Move to use only one ctor
We want to get rid of the other one, it's all internal
API anyway.

Task-number: QTBUG-102855
Change-Id: I2b621c20f4dd7c8bf5f07db8db908c2b7b86976f
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2024-04-17 20:30:36 +02:00
Mårten Nordheim fad8d71262 QSslConfiguration: add documentation for HTTP/2 alpn variable
It was missing for a long time

Pick-to: 6.7 6.5
Change-Id: I209838a3c7b45c8c2e8da21efea306fafddea891
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mate Barany <mate.barany@qt.io>
2024-04-17 20:07:47 +02:00
Giuseppe D'Angelo 7466831509 Long live [[nodiscard]] QFile::open
Having already caught some bugs in real code because of unchecked calls
to QFile::open, this commit marks QFile::open (and open() in other
file-I/O classes) as [[nodiscard]].

Since it's going to raise warnings, the plan is to keep the existing
behavior up to and including the next LTS. Then the warnings will switch
on by default. All of this is protected by system of macros to opt-in or
opt-out the behavioral change at any time.

A possible counter-argument for doing this is that QFile::open is also
used for opening files in the the resource system, and that opening
"cannot fail". It clearly can, if the resource is moved away or renamed;
code should at a minimum use a Q_ASSERT in debug builds. Another
counter-argument is the opening of file handles or descriptors; but
again, that opening may fail in case the handle has been closed or if
the flags are incompatible.

---

Why not marking *every* open() override? Because some are not meant to
be called directly -- for instance sockets are supposed to be open via
calls to `connectToHost` or similar.

One notable exception is QIODevice::open() itself. Although rarely
called directly by user code (which just calls open() on a specific
subclass, which likely has an override), it may be called:

1) By code that just takes a `QIODevice *` and does something with it.
   That code is arguably more rare than code using QFile directly.
   Still, being "generic" code, they have an extra responsibility when
   making sure to handle a possible opening failure.

2) By QIODevice subclasses, which are even more rare. However, they
   usually ignore the return from QIODevice::open() as it's
   unconditionally true. (QIODevice::open() doesn't use the protected
   virtual pattern.)

I'll try and tackle QIODevice in a future commit.

[ChangeLog][QtCore][QFileDevice] The open() functions of file-related
I/O classes (such as QFile, QSaveFile, QTemporaryFile) can now be marked
with the "nodiscard" attribute, in order to prevent a category of bugs
where the return value of open() is not checked and the file is then
used. In order to avoid warnings in existing code, the marking can be
opted in or out, by defining QT_USE_NODISCARD_FILE_OPEN or the
QT_NO_USE_NODISCARD_FILE_OPEN macros. By default, Qt will automatically
enable nodiscard on these functions starting from Qt 6.10.

Change-Id: Ied940e1c0a37344f5200b2c51b05cd1afcb2557d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-04-17 20:07:47 +02:00
Ulf Hermann 674dfdf226 Network: Add Q_GADGET to types exposed in signals and slots
In order to build a complete graph of metaobjects via properties and
methods we need to know about all argument and return types as
metaobjecs. Such a graph is desirable for reasoning about the
consistency of the type system.

Task-number: QTBUG-101143
Change-Id: Ic4e2f58a4275df06178437c6d45270f3f2aa5ce6
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-04-17 09:53:04 +00:00
Piotr Wierciński 655b98482e wasm: Abort network request on destruction of QNetworkReply
Deleting QNetworkReply is a common way to cancel pending request.
Wasm implementation was not treating it properly.

Task-number: QTBUG-124111
Pick-to: 6.7
Change-Id: I46d8624e323fca0932411c575922415d9f9d7986
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
2024-04-16 11:16:17 +00:00
Mårten Nordheim 1d03e1851b QHttp2Connection: fix handling of replies on locally initiated stream
It was overlooked in testing, but it would emit a signal for new
incoming stream even if the server was just replying with HEADERS on a
stream the client had initiated. Or vice-versa.

Pick-to: 6.7
Change-Id: Ie7b3a45729a78106da1d8c058e15705cc7dcc53b
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-04-11 21:53:59 +02:00
Mårten Nordheim 5eecb143bc QNetworkInterface[unix]: fixup some memcpys
There is an untested config for enabling null-strings, so technically
not supported. But if we ever want to make null mean null
then we should protect against it.

Also drop the explicit template argument for qMin. This means
we use the hetereogeneus version which will promote to
size_t. Which is the type that memcpy expects anyway.

Change-Id: I91e0a3b159b065b76e9e93605ef0e502f41af74f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-04-05 21:32:26 +02:00
Mårten Nordheim 4853a52943 Network: cleanliness
QT_NO_CAST_TO_ASCII
QT_NO_CAST_FROM_BYTEARRAY
QT_NO_URL_CAST_FROM_STRING

Change-Id: Ic77ed8ccbdb146b7e7b26123923795f9748d3a38
Reviewed-by: Mate Barany <mate.barany@qt.io>
2024-04-05 21:32:25 +02:00
Mårten Nordheim a786404036 NetworkReply[wasm]: simplify some buffer passing
It was always passing a QByteArray to a const char * argument,
with the size along with it. That was immediately converted
back to a QByteArray. Instead, just pass the byte array
which anyway knows its size.

Needed for a followup commit

Change-Id: I821d419adcb600456826dde67fb92ecad11cb290
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-04-05 18:40:39 +02:00
Piotr Wierciński 157c9eef48 Revert "wasm: Proxy emscripten_fetch() to the main thread"
This reverts commit f2f2b6ef18.

Reason for revert: There are couple of issues introduced. Lets revert to base revision and go with fixes from there.

Pick-to: 6.5 6.6 6.7
Change-Id: I8341de42ef3e4a609bfbffdb763dd5c28794473c
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Even Oscar Andersen <even.oscar.andersen@qt.io>
2024-04-05 14:41:23 +02:00
Matthias Rauter 7d5646c02e Fix range-loop-detach warning in qhttp2connection.cpp
Pick-to: 6.7
Change-Id: I0b02e2f79ab7828858da3b4ca9840ad07d39a70a
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-04-04 17:11:14 +00:00
Matthias Rauter 88f034e556 Remove unused variables in QHttp2Stream::internalSendDATA
Pick-to: 6.7
Change-Id: I13c546c7dc4cc3d15d8d92b62f053e438b5d6b64
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-04-04 17:11:14 +00:00
Matthias Rauter 5e19f4a8b2 Fix fully-qualified-moc-types clazy warnings in qhttp2connection_p.h
Pick-to: 6.7
Change-Id: Ia5cda794989757a501e83c15d1ad348a48ac4923
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-04-04 17:11:14 +00:00
Mårten Nordheim f2159d7131 QRestAccessManager: fix syncqt generation
Apparently it has trouble with multiple attributes between the
class keyword and the class name, looking only for the EXPORT
macros.

As a quick band-aid we can add the #pragma to tell syncqt
to generate the header explicitly.

Pick-to: 6.7
Fixes: QTBUG-123875
Change-Id: If155a5b667b9e71d43dfac04ad19caee0ff23793
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
2024-04-03 10:11:26 +02:00
Timur Pocheptsov 128645d023 Clarify the priority in selecting TLS backends
In case a custom TLS plugin is provided, the order can be unclear
(next after OpenSSL is either Schannel on Windows, or Secure Transport
on Darwin, then a custom plugin, if any, and the last one is 'cert-only').

Pick-to: 6.7 6.6 6.5 6.2
Fixes: QTBUG-123092
Change-Id: I02bcc1fa5448f64846d561a72b2522af3286c66c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-22 16:28:12 +01:00
Mårten Nordheim 505e7ec37d UDP: Protect call to UDP API based on feature
Fails to compile in some qtlite setup

Pick-to: 6.7 6.6 6.5
Change-Id: If04c1ca3f1b4eb59517902b8caab167f4627391b
Reviewed-by: Jari Helaakoski <jari.helaakoski@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-21 19:55:23 +01:00
Anton Kudryavtsev f1b74f7b58 QHttpNetworkConnection: optimize startNextRequest
Use QVLA instead of QQueue to avoid allocations
and use QSpan to emulate queue behavior to avoid N^2

Change-Id: I333bc1af98a596fc041765996867a3d6449fcfde
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-21 14:43:33 +03:00
Mate Barany 282839ad41 Add a means to send a PUT request with an empty body
We have implemented the same functionality recently for POST, in this
patch implement it for PUT.

Task-number: QTBUG-108309
Change-Id: I34c41538054fec836d0d1d1dbb44fabab9bc0e9a
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-19 13:01:31 +01:00
Mate Barany e566a8a968 Add a means to send a POST request that has an empty body
Actually this has already worked if a nullptr was casted as a
QIODevice*. Add an overload with a nullptr_t type, that does
this behind the scenes.

Fixes: QTBUG-108309
Change-Id: I2d4b17ae94cf4de2c42257d471ef901c8994fee5
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-19 13:01:31 +01:00
Øystein Heskestad 89467428f8 QHttp2Connection: Send error for CONTINUATION without preceding data
Send connection error type PROTOCOL_ERROR when receivng CONTINUATION
frames without any data received from previous HEADERS or PUSH_PROMISE
frames, instead of assert.

Task-number: QTBUG-122375
Pick-to: 6.7
Change-Id: Ib14e4610692dc4832b1f3e99dca497d9baf3d9d3
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-18 20:28:36 +01:00
Mårten Nordheim 5ed736b053 Http/2: fix active streams counting
We were looking at all active streams, but that also includes promised
streams.

By the RFC the limitation that our peer specifies only applies to the
number of streams _we_ create, not the total amount of active streams.

More importantly, for the qhttp2protocolhandler it could mean that we
could end up having a few promised streams push the active stream count
over the limit, which could lead us to start more streams than intended
(then bounded by the number of queued requests).

The worst case in this scenario is that a **non-compliant** server
doesn't track how many connections we open and the user has queued
a ton of requests, so we open a ton of streams.

But on the upside: server-push is not widely used.

Pick-to: 6.7
Change-Id: I2a533472eb9127fd176bb99e9db0518f05c3fffe
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-03-18 17:42:19 +01:00
Mårten Nordheim b0b2b7d39d Http2: fix streamsToUse logic
The settings frame with the max streams might be received late
or be revised later, so we cannot assert something on the
relation with the max streams allowed.

Amends 22c99cf498

Pick-to: 6.7
Change-Id: I973dfcf91541becc8c3d6363f9065bb1b9183062
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2024-03-18 17:42:19 +01:00
Øystein Heskestad 9b386127a0 QHttpConnection: Create new streams returns error when ids are exhausted
CreateStream returns a new error code, StreamIdsExhausted, when next
stream id counter exceeds max stream id instead of assert.

Task-number: QTBUG-122375
Pick-to: 6.7
Change-Id: I653b20c24c1429fe88d476beb1ca952aa1bbb320
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-18 13:17:19 +00:00
Piotr Wierciński a5b00cefef wasm: Dont access QNetworkReply header data through dangling pointer
Fixes: QTBUG-122893
Pick-to: 6.5 6.6 6.7
Change-Id: I3768fdffaec7be4ec0b559fdb365600220e648d1
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2024-03-14 18:11:52 +00:00
Marc Mutz 2ff93ea0ee QRestReply: fix "No relevant classes found." moc warning
QRestReply is no longer a QObject, so remove the includemocs line from
the .cpp file.

Amends 9ba5c7ff6a.

Pick-to: 6.7
Change-Id: I6c0ba6b9e3b82f84f3b509755e7da5b33e607776
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
2024-03-14 11:44:16 +01:00
Mårten Nordheim be6644c1f2 Http: fix issues after early abort()
There were a few issues to deal with. One of them was that we would
print a warning about an internal error if we tried to *set* an error
on the reply after it had been cancelled. That's kind of unavoidable
since these things happen in different threads, so just ignore the
error if we have been cancelled.

The other issue was that, for a request with data, we will buffer the
data to send, and _only then_ do we start the request. This happens
asynchronously, so the user can abort the request before it has finished
buffering. Once it finished buffering it would set the state of the
request to "Working", ignoring that it was already marked "Finished".

Fixes: QTBUG-118209
Fixes: QTBUG-36127
Pick-to: 6.7 6.6
Change-Id: Idbf1fd8a80530d802bee04c4b0a6783cba4992d3
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-03-12 14:23:56 +01:00
Mårten Nordheim 22c99cf498 QHttp2ProtocolHandler: prevent truncation in arithmetic operations
On 64-bit systems, both the requests.size() and the
activeStreams.size() were truncated to uint32_t values from int64_t
ones. While extremely unlikely that either will contain more than 4Gi
elements, avoid the truncation by verifying that the `max` amount of
streams is larger than the activeStreams, and then using size_t for
the range.

Pick-to: 6.7
Change-Id: I50644cb634bab0f020acf9aea1d03744b11dbe51
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
2024-03-12 14:23:54 +01:00
Juha Vuolle d8f6425fef Add a QHttpHeaders convenience method for unique header name setting
The function replaces one of the found entries with the new value,
and removes any other entries. If no entries are found, a new entry
will be appended. The replacement search is done for performance
reasons; it's cheaper to replace an existing value.

All in all the function is a more convenient and performant
alternative for this sequence (which proved to be common while
porting QtNetwork internals to QHttpHeaders):
header.removeAll(<headername>);
header.append(<headername>, <value>);

[ChangeLog][QtNetwork][QHttpHeaders] Added replaceOrAppend()
convenience method, which either replaces previous entries with
a single entry, or appends a new one if no entries existed

Fixes: QTBUG-122175
Change-Id: I03957645d7e916a732ac7b8d3ae724bb6b16af87
Reviewed-by: Lena Biliaieva <lena.biliaieva@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-07 23:38:09 +02:00
Juha Vuolle 68ae776e73 Remove 'const' from variable that may be moved
std::move on const object is ineffective, and the code will
use a performance-wise costlier SMF

Amends: 0c05d2b43e

Pick-to: 6.7
Change-Id: Id4a639d9a037c3f1d79ea60faa2715075462fea1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-07 07:21:58 +02:00
Øystein Heskestad 18620ef85f QLocalServer: add protected addPendingConnection function
Add addPendingConnection for subclasses to add socket to queue
of incoming connection for use with newConnection,
hasPendingConnection, and nextPendingConnection.

Task-number: QTBUG-75081
Change-Id: Id242a0c3573ee511b403d18af25864add9a3b684
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-05 14:43:29 +00:00
Juha Vuolle b370e1b7f1 DRY QHttpHeaders::value() implementation
Pick-to: 6.7
Task-number: QTBUG-122020
Change-Id: I403d376734587d721d27f7093b3774068829a46d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-05 08:10:20 +02:00
Juha Vuolle 9c0a79d323 DRY QHttpHeaders::values() implementation
Pick-to: 6.7
Task-number: QTBUG-122020
Change-Id: I7401eef86b133d33f32cd786dffe9a06c4ac7aba
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-05 08:10:17 +02:00
Juha Vuolle de37316160 DRY QHttpHeaders::combinedValue() implementation
Pick-to: 6.7
Task-number: QTBUG-122020
Change-Id: I6232ea725d47800a9236ed90b70004a915bc8b65
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-05 08:10:14 +02:00
Juha Vuolle c0e4b73743 QHttpHeaders: remove unused Header::operator==()
The QHttpHeaders comparison was dropped earlier, and the current code
no longer needs to compare both header entry 'name' and 'value'.

Pick-to: 6.7
Change-Id: I57a3003f0fd1d8ff867c970d5ec8a994a167ae88
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2024-03-05 08:10:11 +02:00
Juha Vuolle 9e26a8c082 Document QHttpHeaders::WellKnownHeaders as the recommended overloads
... from a performance point of view.

Pick-to: 6.7
Task-number: QTBUG-122020
Change-Id: I8a1558a46e74d740e330ad483454267f9922a5d5
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-05 08:10:09 +02:00
Juha Vuolle 0c05d2b43e Make HTTP header name a variant / union for performance
This saves memory and can speed up performance with
well-known headers.

The change consists of:
- Change the internal type of 'name' to a std::variant
  capable of holding either WellKnownHeader-enum, or a QBA.
- Accordingly, add an equality operator.
- When headers are added (append, insert, replace) then
  use WellKnownHeader as storage type when possible;
  either use the function parameter directly if a WellKnownHeader
  overload was used, or check if the provided string can
  be converted to a WellKnownHeader.
- Convert other functions to use a more performant
  lookup/comparisons.

Pick-to: 6.7
Fixes: QTBUG-122020
Change-Id: If2452f6edc497547246fb4ddbace384e39c26c5e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-05 08:10:05 +02:00
Juha Vuolle d3860b1b73 Move few QHttpHeaders helper functions on top
As a prequel to make subsequent diff on the followup
commit (std::variant/union) smaller

Pick-to: 6.7
Task-number: QTBUG-122020
Change-Id: Iaa5dd794dc7a9e33c2c43e459bf5dbd19afb3ba1
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-05 08:10:02 +02:00
Juha Vuolle dd3af7e4e2 Add sorted lookup table for QHttpHeaders name fields
This allows a more performant (O(logN)) lookup for WellKnownHeader
enum (followup commit).

The lookup table is currently crafted manually. It may in future be
generated at compile-time, but this should only be done if new headers
are appended often; we don't want to unnecessarily bloat compilation
time either.

Pick-to: 6.7
Task-number: QTBUG-122020
Change-Id: I0329902b13128f03c358796d5cda7014b1e75057
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2024-03-05 08:09:59 +02:00
Matthias Rauter 3f26fdebbc Implement ping reply in QHttp2Connection and add test
Fixes: QTBUG-122338
Change-Id: I1e8dfa8a93c45dbe12a628d4d5e79d494d8f6032
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-04 20:14:36 +01:00
Ahmad Samir c610cfe328 Mention QChronoTimer in API docs
Change-Id: Iaf9fb31994f1580b2051dbd0b1b8eef2a218aa39
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-03 19:56:55 +02:00
Ahmad Samir 7cf39bd785 Port to QDirListing
Use QDirListing in the Bootstrap build instead of QDirIterator.

Drive-by changes:
- more const variables
- use emplace_back() instead of append() where appropriate

Change-Id: Ie1f0d03856e557c4bfabfff38a87edc7da86d091
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-03 14:02:07 +02:00