| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Prior to switching the protocol handler to use QHttp2Connection this
particular issue (see bugreport) was not a problem because the handling
of the IO-device being destroyed was simply to drop any pointer to
it.
QHttp2Stream, however, also has to keep track of the lifetime of
the IO-device, because it needs to abort the stream if the data
it's uploading is destroyed earlier than expected.
Now, since QHttp2Stream might also have other errors come up, we
have to connect to the generic 'errorOccurred' signal from it and
handle whatever issues arise, notifying our users that the request
for some reason cannot be fulfilled.
It's thanks to this part that we were now, in certain cases,
grabbing a stale pointer to the HttpNetworkReply and trying to
call functions on it.
We fix this somewhat indirectly. Because, after a HttpReply is
destroyed, we shouldn't even have any references to it in the
first place. And while it would usually be done as part of
handling the deleted() signal, we actually disconnect from
HttpNetworkReply's signals when we have processed one of the
finished*() functions. But since we were still connected to the stream's
signals we would still try to handle it.
For the http1 protocol handler this was already handled in
QHttpNetworkConnection::removeReply, which the HttpNetworkReply itself
calls at start of destruction. The function will go through any place
that the reply can be referenced and removes it. For http/2 it would
remove it from the list of requests yet to be sent, but not from the
in-progress list. So, we now add a new virtual function to the
AbstractProtocolHandler and specialize it in Http2 to handle exactly
this.
Fixes: QTBUG-136549
Pick-to: 6.9.1 6.9
Change-Id: Ie41863677a3b163f77d10bc3904ca515f6840be3
Reviewed-by: Mate Barany <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
| |
Ensure that link-local IPv6 addresses in a HTTP Request do not
include the zone identifier in the 'Host' header, as per RFC 6874.
This prevents connection failures due to invalid host syntax.
Fixes: QTBUG-134727
Change-Id: I7067a991f67d44241717a89b656a3fcbda1fcd3a
Reviewed-by: Øystein Heskestad <[email protected]>
Reviewed-by: Thiago Macieira <[email protected]>
|
|
|
|
|
|
|
|
|
| |
Amends a41c860c7dacfb6b785e0a24a4c3f26c3cde3c20
Task-number: QTBUG-115841
Change-Id: If8a65513935899085f135a22b42d756f1a3fbebc
Reviewed-by: Mårten Nordheim <[email protected]>
Reviewed-by: Thiago Macieira <[email protected]>
|
|
|
|
|
|
|
| |
Task-number: QTBUG-115841
Change-Id: I34f3106e4b50a18cc19c4cda597205c346e7561e
Reviewed-by: Mårten Nordheim <[email protected]>
Reviewed-by: Øystein Heskestad <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
| |
Since we will need to turn off this feature for certain platforms, code
must compile with QT_FEATURE_localserver turned off, which now can't.
Fix this by disabling parts of code requiring QT_FEATURE_localserver.
Task-number: QTBUG-115777
Pick-to: 6.8
Change-Id: I6d78030db67ee679d6877b48a437db90a6e47a02
Reviewed-by: Mårten Nordheim <[email protected]>
|
|
|
|
|
|
|
|
|
|
| |
[ChangeLog][QtNetwork][QNetworkAccessManager] QNetworkAccessManager now
supports using full local server name, as in, named pipes on Windows or path to
socket objects on Unix.
Task-number: QTBUG-102855
Change-Id: Ifc743f5025b3d8d0b558ecffff437881897915d9
Reviewed-by: Timur Pocheptsov <[email protected]>
|
|
|
|
|
|
|
|
|
|
| |
[ChangeLog][QtNetwork][QNetworkAccessManager] QNetworkAccessManager now
supports local connections using the uri schemes unix+http: or
local+http:.
Fixes: QTBUG-102855
Change-Id: I1f47b74ab42b51d97b3c555cc3afd6ccd272e1ed
Reviewed-by: Mate Barany <[email protected]>
|
|
|
|
|
|
|
| |
Task-number: QTBUG-102855
Change-Id: Idcf571498b7a18792cf7843a826d78672e264a73
Reviewed-by: Mate Barany <[email protected]>
Reviewed-by: Timur Pocheptsov <[email protected]>
|
|
|
|
|
|
|
|
|
| |
+ a small stretch into adjacent functions, because some are used from
the protocol handler(s).
Task-number: QTBUG-102855
Change-Id: Ie394378fef2b1723e69286fd870fc34b7306734a
Reviewed-by: Thiago Macieira <[email protected]>
|
|
|
|
|
|
|
|
|
| |
In preparation for the socket potentially being a QLocalSocket.
Task-number: QTBUG-102855
Change-Id: I9889f72fc55d945ba6c392d573293628ec052164
Reviewed-by: Edward Welbourne <[email protected]>
Reviewed-by: Mate Barany <[email protected]>
|
|
|
|
|
|
| |
Task-number: QTBUG-102855
Change-Id: Idcb67b434f9f627a408d730d9cec8d749094728e
Reviewed-by: Edward Welbourne <[email protected]>
|
|
|
|
|
|
|
|
| |
Initialize the hardcoded things inside the class.
Task-number: QTBUG-102855
Change-Id: I06da0a615ec066e63d9cd0359313e8e8f588718e
Reviewed-by: Edward Welbourne <[email protected]>
|
|
|
|
|
|
|
|
|
| |
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 <[email protected]>
|
|
|
|
|
|
|
| |
Task-number: QTBUG-102855
Change-Id: Ifcd25c241f2e331b0c271d3462b5a2896797d101
Reviewed-by: Edward Welbourne <[email protected]>
Reviewed-by: Timur Pocheptsov <[email protected]>
|
|
|
|
|
|
|
|
|
| |
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 <[email protected]>
|
|
|
|
|
|
|
|
|
| |
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 <[email protected]>
Reviewed-by: Mårten Nordheim <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
QHttpHeaderParser::headers() method is changed to return QHttpHeaders.
QAuthenticatorPrivate::parseHttpResponse() method is changed to work with QHttpHeaders.
QHttpNetworkHeader::header() method is updated to return QHttpHeaders.
Tests are updated.
Task-number: QTBUG-120133
Change-Id: I20a18b509acd7a8b8d93884cff8349519d64293e
Reviewed-by: Ievgenii Meshcheriakov <[email protected]>
Reviewed-by: Mårten Nordheim <[email protected]>
Reviewed-by: Øystein Heskestad <[email protected]>
|
|
|
|
|
|
|
| |
to avoid needless tmp allocation
Change-Id: I582f86adbe274b67ddbc7255caea63a39137edcc
Reviewed-by: Mårten Nordheim <[email protected]>
|
|
|
|
|
|
|
|
| |
These get methods (sslContext and connectionType)
are part of private API, so it's safe
Change-Id: I6c2e14d5dbcbefc051d69985d1e9b490274ba7ef
Reviewed-by: Mårten Nordheim <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We were using the .remove(Key) API on the map instead of
erase(iterator), so we were removing any reply of the same priority that
had not yet been popped from the queues.
Rewrote to drop loop and only work with iterators.
This issue was there since SPDY days, so not picking all the way back to
5.15, where HTTP2 anyway is not enabled by default.
As a drive-by, drop the #ifndef QT_NO_SSL, which was also there from
SPDY times, which was TLS-only.
Pick-to: 6.6 6.5 6.2
Fixes: QTBUG-116167
Change-Id: Id7e1eb311e009b86054c1fe3d049c760d711a18a
Reviewed-by: Edward Welbourne <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
| |
We have code in the protocolHandlers that tries to handle this case, but
if we have an error before we create protocolHandler (read: proxy
complains about something) we will assert in debug, or
deref nullptr in release.
Pick-to: 6.6 6.5 6.2
Change-Id: I4bde9c8af0fa96dc11f77ca4d4b5cb84c31b54fa
Reviewed-by: Edward Welbourne <[email protected]>
Reviewed-by: Timur Pocheptsov <[email protected]>
|
|
|
|
|
|
|
| |
Prefer QLatin1StringView overloads
Change-Id: I23846761f2c93021de4f6e6b7eba1d74045f89a1
Reviewed-by: Edward Welbourne <[email protected]>
|
|
|
|
|
|
|
|
|
| |
and micro optimize it:
- avoid allocation in case of C locale
- don't call replace in case of C locale
Change-Id: I9afefd53b673e5f1236afdb3130d77779614acc7
Reviewed-by: Mårten Nordheim <[email protected]>
|
|
|
|
|
|
|
| |
Encodings are configured at compile time, so no need to re-create acceptedEncoding header for every request, just cache it.
Change-Id: Ibfaf7cdec0504cf90c4b6a59848e7c945d060ebe
Reviewed-by: Mårten Nordheim <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Because we didn't handle Negotiate in the "Start" phase during
handleAuthenticateChallenge, we would not emit the auth signal before
our second attempt, assuming the server prompts us for one.
Emitting the authenticationRequired signal is needed for users
to be able to set the Service Principal Name (SPN) option.
Alternatively, username and password if not relying on Single sign-on.
Done-by: Emil Wipplinger <>
Pick-to: 6.6 6.5
Fixes: QTBUG-114559
Change-Id: I833c08dfeda36a6548c5ad6b8af4b8aa9d644c45
Reviewed-by: Edward Welbourne <[email protected]>
Reviewed-by: Timur Pocheptsov <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Map QNetworkError::HostNotFoundError and QNetworkError::ConnectionRefusedError
to ProxyNotFoundError resp. ProxyConnectionRefusedError when it originated
from the communication with the proxy server.
Fixes: QTBUG-68821
Pick-to: 6.5 6.6
Change-Id: I21b91f2667ba0cd329d4ece1fe543472cdab2d22
Reviewed-by: Qt CI Bot <[email protected]>
Reviewed-by: Mårten Nordheim <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
| |
Introduces new class QHttp1Configuration.
[ChangeLog][QtNetwork][QHttp1Configuration] New class.
Fixes: QTBUG-25280
Fixes: QTBUG-108215
Change-Id: Ide6cee23946e5001befb8fab34edf10b8a66e02b
Reviewed-by: Mårten Nordheim <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.
Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace, with manual
unstaging of the actual definition and documentation in dist/,
src/corelib/doc/ and src/corelib/global/.
Task-number: QTBUG-99313
Change-Id: I4c7114444a325ad4e62d0fcbfd347d2bbfb21541
Reviewed-by: Ivan Solovev <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is semantic patch using ClangTidyTransformator:
auto QtContainerClass = expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o)
makeRule(cxxMemberCallExpr(on(QtContainerClass),
callee(cxxMethodDecl(hasAnyName({"count", "length"),
parameterCountIs(0))))),
changeTo(cat(access(o, cat("size"), "()"))),
cat("use 'size()' instead of 'count()/length()'"))
a.k.a qt-port-to-std-compatible-api with config Scope: 'Container'.
<classes> are:
// sequential:
"QByteArray",
"QList",
"QQueue",
"QStack",
"QString",
"QVarLengthArray",
"QVector",
// associative:
"QHash",
"QMultiHash",
"QMap",
"QMultiMap",
"QSet",
// Qt has no QMultiSet
Change-Id: Ibe8837be96e8d30d1846881ecd65180c1bc459af
Reviewed-by: Qt CI Bot <[email protected]>
Reviewed-by: Volker Hilsheimer <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With NTLM/Negotiate we delete the context used to generate replies once
we get SEC_E_OK. Due to some faulty logic in the http backend we could
end up trying to generate another response. Qt would then pass
references to some offsets of nullptr into the API calls causing it to
crash. Add some sanity checks before the "sspi continue" calls to make
sure this won't happen, and update the condition in the http
backend to check that we have not already sent our credentials.
As a drive-by: correct the initialization of the handles to use
SecInvalidateHandle instead of memset to 0.
Pick-to: 6.4 6.3 6.2 5.15
Fixes: QTBUG-102359
Change-Id: I884ff8fc70609fe8746b99a1d56eeafcda9d2620
Reviewed-by: Qt CI Bot <[email protected]>
Reviewed-by: Edward Welbourne <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The output was only printed if the request was no longer available
queued, meaning that it had been removed before the socket had finished
its connection attempt. That means the result of the attempt is not of
much interest to the user so we should not print it out as a warning.
The reason for why the request was removed from the queue would be the
interesting bit, but it's not covered here.
Task-number: QTBUG-85248
Pick-to: 6.4 6.3 6.2 5.15
Change-Id: Iac483b8bb600e1577fe88c3699e46d50615bfccb
Reviewed-by: Timur Pocheptsov <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
| |
Otherwise the errorString from qtls_openssl is lost that
would help a lot why a tls connection failed.
"Error during SSL handshake: error:1414D17A:SSL routines:tls12_check_peer_sigalg:wrong curve"
Pick-to: 6.4 6.3 6.2
Change-Id: Iab74b73488219686e5926308db02bc4063818c9f
Reviewed-by: Mårten Nordheim <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
Files that have to be modified by hand are modified.
License files are organized under LICENSES directory.
Task-number: QTBUG-67283
Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1
Reviewed-by: Qt CI Bot <[email protected]>
Reviewed-by: Lars Knoll <[email protected]>
Reviewed-by: Jörg Bornemann <[email protected]>
|
|
|
|
|
|
| |
Task-number: QTBUG-98434
Change-Id: Ic235b92377203f7a1429ae7fd784c4a1fa893e9f
Reviewed-by: Mårten Nordheim <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
| |
If the user supplied a content-length, and we also know the size of the payload
then we would set the content-length again, which is a remove + add on a QList.
This is completely avoidable if we are setting the same size anyway.
Fixes: QTBUG-102495
Change-Id: If62739cadb453dbda4c21e858ba3a17baaf71fb4
Reviewed-by: Edward Welbourne <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
To enable its use in the http2 protocol handler.
This factors out the error-reporting code for HTTP 1, which in
any case has to be done differently for HTTP 2, saving duplication
and simplifying the redirect handling code.
Task-number: QTBUG-100651
Pick-to: 6.3 6.2 5.15
Change-Id: I4b470646a9ad5ee702c9b1921d115e137d3d5b8b
Reviewed-by: Edward Welbourne <[email protected]>
Reviewed-by: Øystein Heskestad <[email protected]>
Reviewed-by: Marc Mutz <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adds a new state Phase1 to QAuthenticatorPrivate::Phase which is used
when authenticating using Ntlm. The new state forces an emit of the
authenticationRequired signal and tracks that it is called only once.
Fixes: QTBUG-44096
Pick-to: 6.2 6.3 5.15
Change-Id: Icc9662d4fdc1f0f8c8e8bc5538f211baaa055d4c
Reviewed-by: Mårten Nordheim <[email protected]>
Reviewed-by: Timur Pocheptsov <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Proxy settings should always be set to all channels because after switching
from HTTP/2 to HTTP/1.1 they may all be used.
Problem was made in commit 8b9d246225dcd63900399297b0fd553918840bea. It is
introduce the QHttpNetworkConnectionPrivate::activeChannel field, which value
is 1 got HTTP/2 by default, but can later be changed to 6 if the remote host
doesn't support HTTP/2.
Pick-to: 6.3 6.2 5.15
Change-Id: Idcdeb22ec806520965f30a22045f99aa009a7362
Reviewed-by: Mårten Nordheim <[email protected]>
|
|
|
|
|
| |
Change-Id: If6dabc94f6d64695a0b28e73061274f8ea1c4ed6
Reviewed-by: Tor Arne Vestbø <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
| |
These signals allow monitoring where in the HTTP1/HTTP2
flow a request is currently in.
Fixes: QTBUG-71698
Fixes: QTBUG-18766
Change-Id: Icc2fe435afc9f680fa7a76c32731e25fcdfeb4b4
Reviewed-by: Qt CI Bot <[email protected]>
Reviewed-by: Mårten Nordheim <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
| |
... instead of QSharedPointer.
QSharedPointer performs twice as many atomic operations per pointer
copy as std::shared_ptr, and this is private API, we're not bound by
BC constraints, so we can port to the more efficient version.
Change-Id: I2e2a02493565a7ca51c86ec0ed66b6ce7c763e41
Reviewed-by: Mårten Nordheim <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
| |
Rather than when the data is received. Source compatibility is
achieved through double-decompressing the data. This lets us know
how many bytes are available just as before but without having the
uncompressed data left in memory.
Fixes: QTBUG-83269
Change-Id: I352bd09581614c582e4628243e2a0e895ba4946b
Reviewed-by: Edward Welbourne <[email protected]>
|
|
|
|
|
|
|
|
|
| |
Grab a reference to the channel instead of indexing into the array
repeatedly.
Change-Id: I114d571fcfcfd3a751346b513cec728dc2fcda0a
Reviewed-by: Timur Pocheptsov <[email protected]>
Reviewed-by: Edward Welbourne <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We store the authenticator right alongside it, which knows the
method.
The biggest change from this is changing a, self-proclaimed, duplicate
method from QHttpNetworkReply. Finding the method name ahead-of-time
is not actually needed, all we need to know is that a supported
authentication method is requested. Also moved that specific
functionality to a more logical location: QAuthenticatorPrivate.
Change-Id: I11627803ccb42b8ec33a28ef1d1e00bf60dc6da9
Reviewed-by: Edward Welbourne <[email protected]>
Reviewed-by: Timur Pocheptsov <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When IPv4 and IPv6 are supported by a server, QHttpNetworkConnection
will start up two connections and pick the network layer of the one
that finish first. In this case the channel with index 1 is used for
IPv6. When IPv6 wins, there is no channel at index 0. This situation
needs to be respected and we should try to use existing channels first
when there is a next request.
This is especially important when TLS session resumption is used.
Creating a new channel will cause to lose the ephemeralServerKey
used in the first connection.
Fixes: QTBUG-93295
Pick-to: 5.15 6.1
Change-Id: Ic9dc6a24ef793a29c2652ad37bc11120e2e6ceef
Reviewed-by: Mårten Nordheim <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With Qt 6 we made HTTP/2 default, which exposed missing handling of
401 Unauthorized (and 407 Proxy Authentication Required).
In HTTP/1.* we would handle this after the response had finished, while
handling the status code. For h2 this path isn't used since it is
heavily reliant on the structure we have for HTTP/1.* (one request per
channel). So we must handle the status code and header directly.
Having that part fixed exposed another issue - when resetting/rewinding
uploaded data we were not resetting the 'totallyUploadedData' counter in
the reply (this, in turn, exposed another small issue). Because of that
we did not actually send any data on the retry, only sending the
content-length followed by no data.
Finally, the small issue mentioned in the previous paragraph was how we
check if we have uploaded all our data. It was only checking if the
byte-device was atEnd(), which it was. But only because it had not yet
prepared any data for us.
Fixes: QTBUG-91284
Pick-to: 6.1 6.0 5.15
Change-Id: I798d105b02688b18a02897cc476f19f57a47f98f
Reviewed-by: Timur Pocheptsov <[email protected]>
Reviewed-by: Edward Welbourne <[email protected]>
|
|
|
|
|
|
|
|
|
|
| |
Since the old code is now fully integrated in QNetworkInformation backends
Change-Id: Ia843d17bb3c98333e8d68752e25722b5860f48e0
Reviewed-by: Timur Pocheptsov <[email protected]>
Reviewed-by: Edward Welbourne <[email protected]>
(cherry picked from commit 7860b9e6ffece207d054ac0c321bc3c5b983708f)
Reviewed-by: Qt Cherry-pick Bot <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously we only checked if there was something in the h2 queue or
if we had not yet switched to http2. These means in some cases that
following an error it would enter this branch and, because it had not
yet switched to http2, it would call 'ensureConnection' which would try
start a reconnection. This could make the proxy socket engines try to
emit 'auth required' with no replies, meaning nothing happens.
Fixes: QTBUG-88417
Pick-to: 5.15 6.0
Change-Id: If37b8c71ac36597adc305fb1b1ea4fa7b48b0d28
Reviewed-by: Timur Pocheptsov <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
| |
AFAICT with GSSAPI the normal workflow is to run kinit or similar and
authenticate before running programs relying on it. Therefore
we can try to get the credentials before we choose whether or not
to use Negotiate.
Pick-to: 5.15
Task-number: QTBUG-85123
Change-Id: If0478fdd45389b2939ad87c2f582776fe56959bb
Reviewed-by: Timur Pocheptsov <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
| |
It really could only manifest itself if you started a request and then
immediately cancelled it and then started another one to the same
site. But only if in a certain race outcome - the connection that the
backend was establishing had to finish connecting after aborting but
before a new request had been queued!
Change-Id: I7cad2cf4ac1f64cc838498cefa076cd2c6d26701
Reviewed-by: Alex Blasche <[email protected]>
Reviewed-by: Timur Pocheptsov <[email protected]>
|