Commit Graph

1444 Commits

Author SHA1 Message Date
Tor Arne Vestbø
c70bb357cc Fix loading of OpenSSL on macOS versions that ship its own OpenSSL
The unversioned libcrypto.dylib that's shipped with macOS 10.15 will
result in a crash if loaded, with a message saying that the unversioned
library should not be loaded, as it doesn't provide a stable ABI.

Task-number: QTBUG-95249
Pick-to: 6.2 5.15
Change-Id: I49325e5d675155e90840cc93623549f725bc77b4
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-09-17 16:09:51 +02:00
Mårten Nordheim
c942bae4eb tst_http2: Fix flaky authentication test
The h2 server is running in a separate thread, so while the previous
test was finished and the server was deleted, it could still emit
and have a queued emission in-flight which would be picked up by
the next running test.

Pick-to: 6.2 6.1 5.15
Change-Id: I26b1bc711df7473032d6078f35f8aca37c40137e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-09-10 14:17:05 +00:00
Øystein Heskestad
9a602e68cf Move QNAM's http header parsing into separate class
Fixes: QTBUG-80701
Change-Id: I43f5e102c15d121dba74e07e3cd4bb8aded1c763
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-09-09 16:55:50 +02:00
Alex Trotsenko
5d68858ba7 QLocalSocket/Win: fix waitFor...() functions for write-only socket
There were several issues with the socket state checking when the pipe
reader is not running:

  - the number of object handles in the WaitForMultipleObjectsEx()
    call might have been zero;
  - a call to the waitForDisconnected(-1) might have hung;
  - we did not perform a loop iteration for the waitFor...(0) calls,
    so disconnect detection was unreliable.

These issues are related to the same code, so they don't seem to be
addressable separately.

Change-Id: I3bca872bb4191e6a7d38a693d81f7981af7fe145
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-09-02 08:47:11 +03:00
Mårten Nordheim
9258c50936 tst_QNetworkReply: Remove and suppress one debug message
There's not much context to the URLs being printed, so remove the
message. And suppress the message coming from the MiniHttpServer

Change-Id: Ie2025ac717657ed0f2f0163bd0af22e12a49b30f
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-09-01 18:03:15 +02:00
Mårten Nordheim
4757b93b0e Test QNetworkAccessCache insertions with varying expiry times
The insertions are sorted by when they expire. So, we test the various
orders to insert entries.

Fixes: QTBUG-95959
Change-Id: I1e8d7f4c77dce5eae3d4bfa5101f296c3eea1961
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-09-01 18:03:15 +02:00
Ievgenii Meshcheriakov
a7484002a3 tests: Remove unused SRCDIR defines
Remove SRCDIR defines from tests that don't use them. There is a
standard define called QT_TESTCASE_SOURCEDIR that is available to all
tests and serves the same purpose.

Pick-to: 6.2
Change-Id: I2aa237739c011495e31641cca525dc0eeef3c870
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-08-17 12:41:57 +00:00
Ievgenii Meshcheriakov
c859b335b9 tests: Use QT_TESTCASE_SOURCEDIR define
Replace custom SRCDIR define with QT_TESTCASE_SOURCEDIR. The latter is
automatically available to all tests to use and serves the same purpose
but is not terminated by a slash.

Change-Id: I62896d0fd84ac63ac1b74a459ec1646c6bde0a46
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-08-11 21:03:56 +02:00
Timur Pocheptsov
33de5f6502 tst_QSslSocket - replace an old certificate
Helped quite a lot with OpenSSL 3 not accepting some old algorithms.

Pick-to: 6.2 6.1 5.15
Task-number: QTBUG-95123
Change-Id: If4894fa86eba7b002465fa661d436ae6ea751989
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-08-10 14:21:58 +02:00
Timur Pocheptsov
e7ab17ade1 tst_QSslCertificate::verify - remove QSKIP
And re-generate certificates.

Fixes: QTBUG-95429
Pick-to: 6.2 6.1 5.15 5.12
Change-Id: Id970a0a9315d146d6dd1e66c9cff9b7d75657e2d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-08-06 16:08:43 +02:00
Mårten Nordheim
b41d5f6293 QDecompressHelper: Skip double-decompression if download is small
To retain backwards compatibility with some QNetworkReply usage,
namely connecting solely to finished-signal and allocating a buffer to
read into, but without storing the entire decompressed file in memory
until read, we may decompress the file twice.

With this patch users can now avoid this double decompression if the
amount of buffered data stays below 10 MiB. This means any file smaller
than 10 MiB will never need to be decompressed twice to know the size of
it. On top of that, if the data is handled as it arrives (e.g. in
readyRead) and the buffer is kept below 10 MiB it won't need to
decompress twice either.

This is active as long as "countDecompressed" is true, though it
currently always is in QNetworkAccessManger, with a future goal to make
it possible to control with public API. Since it requires the user to
potentially adapt their usage of QNetworkReply.

In this patch we also stop tracking the amount of unhandled uncompressed
bytes (uncompressedBytes) in favor of tracking the total amount of bytes
which has been read() by the user of QDecompressHelper (totalBytesRead),
since we can more intuitively work out the total amount of unread bytes
using this value.

Change-Id: Ie3d8d6e39a18343fcf9b610f45c7fe7e4cd4e474
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-08-04 19:31:52 +02:00
Tor Arne Vestbø
bef57b317f testlib: Deprecate QWARN() in favor of qWarning()
The QtTest best practices documentations recommends using output
mechanisms such as qDebug() and qWarning() for diagnostic messages,
and this is also what most of our own tests do.

The QWARN() macro and corresponding internal QTest::qWarn() function
was added when QtTest was first implemented, but was likely meant as
an internal implementation detail, like its cousin QTestLog::info(),
which does not have any corresponding macro.

This theory is backed by our own QtTest self-test (tst_silent)
describing the output from QWARN() as "an internal testlib warning".

The only difference between QWARN() and qWarning(), besides the much
richer feature set of the latter, is that qWarning() will not pass
on file and line number information in release mode, but QWARN() will.
This is an acceptable loss of functionality, considering that the user
can override this behavior by defining QT_MESSAGELOGCONTEXT.

[ChangeLog][QtTest] QWARN() has been deprecated in favor of qWarning()

Pick-to: 6.2
Change-Id: I5a2431ce48c47392244560dd520953b9fc735c85
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-08-04 19:31:51 +02:00
Alex Trotsenko
9f092c1077 QIODevice: rework validation policy for read() functions
- avoid calls to private and virtual functions, if the device is not
  open;
- avoid repetitive checks in loops;
- add missing checks in readLine() overloads;
- remove check against unsuccessful resize().

Change-Id: I973d5931163b25db1c09c7c3b66f29ea90bb1b29
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-08-01 10:50:32 +03:00
Alex Trotsenko
21f3ff65b8 QLocalSocket: do not emit aboutToClose() twice
This signal is emitted by the QIODevice itself, so we don't have to
forward it from the internal socket.

Pick-to: 6.1 6.2
Change-Id: I85745f36d7a27d92f339a9184de3b6e5d46f6f34
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-08-01 10:50:15 +03:00
Timur Pocheptsov
8d0e4a2e5c tst_QSslCertificate::verify - skip auto-test
as a temporary fix for suddenly expired certificates situation (to
be regenerated).

Pick-to: 6.2 6.1 5.15
Task-number: QTBUG-95429
Change-Id: I00ad11cfd8824eeeffa2991dfcda6a7899726953
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-07-29 08:09:55 +02:00
Markus Goetz
85cfbae1d6 QNAM: Allow to configure when connections to a host are torn down
This introduces a new attribute that allows behavior to keep
the TCP connection(s) to a HTTP1/HTTP2 host longer or shorter
than the default of 120 seconds.
Note that the server might still close the connection earlier.

Fixes: QTBUG-20726
Fixes: QTBUG-91440
Change-Id: I7da64230a78c642c12c0ddbe6b678cf17c3aafde
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-07-27 17:16:58 +02:00
Alex Trotsenko
921ff400bb QLocalSocket/Win: allow delayed close to work
This mechanism was neither properly designed nor correctly tested
initially on Windows.

[ChangeLog][QtNetwork][Important Behavior Changes] QLocalSocket on
Windows now implements delayed closing, which is consistent with
the behavior on Unix.

Change-Id: Ic3bc427e68eea7f18201f6129df19fbc87d68101
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-07-25 10:06:27 +03:00
Alex Trotsenko
f18d8fd1fb QLocalSocket/Win: do not close the device on disconnectFromServer()
It's the user's privilege to do so when they want to finish reading the
QIODevice. Moreover, this is the only difference between close() and
disconnectFromServer().

[ChangeLog][QtNetwork][Important Behavior Changes] The Windows
implementation of QLocalSocket::disconnectFromServer() no longer calls
close(), which is consistent with the behavior on Unix.

Change-Id: Ie9ce20c60259a2b08f5254b719355bd7be9b17cd
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-07-24 21:46:44 +03:00
Alex Trotsenko
6481733d45 QLocalSocket/Win: do not flush the pipe in disconnectFromServer()
In the case where we have pending data to write, calling flush() here
may cause the device to close immediately, if the pipe writer already
got a result of the last operation from the thread pool. In this
scenario, the device does not enter the 'Closing' state, which leads
the following code to unexpectedly fail on Windows

  socket.write(...);
  socket.disconnectFromServer();
  QVERIFY(socket.waitForDisconnected());

Removing the call to flush() makes the behavior consistent with the
implementation on Unix.

Change-Id: Ic31fbc999be979c1e5befa8f132d9fb367f472ca
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-07-24 16:55:43 +03:00
Alex Trotsenko
d9c0af92bd QLocalSocket/Unix: fix aborting the socket
According to the documentation, calling abort() should immediately
reset the socket to its initial state. This includes:

  - closing the file descriptor;
  - closing the QLocalSocket as an I/O device;
  - canceling a pending outgoing connection, if it exist;
  - reseting 'serverName' string.

So, adding a call to close() resets the state entirely.

Pick-to: 6.1 6.2
Change-Id: I9c604b5187c6300b437d7aa4c2d06db03edacf21
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-07-24 11:52:30 +03:00
Markus Goetz
e1b010ff47 QNetworkReply: Add two new signals
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 <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-07-20 22:08:39 +02:00
Mårten Nordheim
9c67aa2da1 tst_QSslSocket: fix and clean up allowedProtocolNegotiation
The server's socket may not have been created yet, so use the server's signal
instead.
Switch to QCOMPARE to get better output.
Delete the extra checking for schannel, we don't support Windows 8 anymore.

Pick-to: 6.2
Change-Id: Icd310c32939cb577c9f3438789f667aa0a3a4d85
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-07-20 21:17:50 +02:00
Mårten Nordheim
d9f80502f6 QNetworkDiskCache: Fix tracking of size during storeItem()
If the file already existed we simply removed the old one without
adjusting the size. So use the removeFile() function which takes care of
that.

Additionally, if the current size was non-null we previously increased
the size (presumably meant to be temporarily but wasn't) and called
expire() which would either:
1. not do anything and return currentCacheSize, if it was not greater
than the max size. This would mean that the size of the file would be
counted twice.
or,
2. discard currentCacheSize, measure the size of the items, and then
remove some items if the total size surpassed the max cache size

Neither of those branches need us to (temporarily) increase
currentCacheSize. It also doesn't attain the (presumed) goal of trying
to keep below the max cache size after having added the new item.

Fixes: QTBUG-95009
Pick-to: 6.2 6.1 5.15
Change-Id: I2b5b13ff473a7aa8169cf2aecfea783c97f2d09a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-07-20 18:30:44 +02:00
Timur Pocheptsov
c23b788634 H2: emit encrypted for at least the first reply, similar to H1
Pick-to: 6.2 6.1 5.15
Fixes: QTBUG-95277
Change-Id: I1fe01503376c0d6278e366d7bd31b412b7cc3a69
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-07-20 18:30:44 +02:00
Daniel Nicoletti
e095fa7f9c Allow to set TCP network listen(2) backlog
Qt has a hardcoded backlog value of 50,
this allows for applications to tune this
value. Modern kernels have the SYN cookie
feature that reduces pressure from an
flood attack, the backlog setting however
is then a queue for most likely real
completed (SYN/ACK) connections hence, it's
easy to get clients connections dropped
with this very small limit.

[ChangeLog][QtNetwork][QTcpServer] Added
QTcpServer::setListenBacklog() to be able
to have control over the listen backlog feature.

Change-Id: I1c78af6d99e012591e214b7e09fa85c485880d48
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2021-07-19 17:05:53 -03:00
Alex Trotsenko
6c1bc7798b QLocalSocket/Win: destroy the pipe before emitting final signals
Both readChannelFinished() and disconnected() signals should be emitted
after closing the pipe. Otherwise, these signals do not correspond to
the state of the socket and may even be resent, if a slot connected to
one of these signals processes events.

[ChangeLog][QtNetwork][Important Behavior Changes] QLocalSocket on
Windows now emits both readChannelFinished() and disconnected() signals
after closing the pipe and emitting stateChanged(UnconnectedState),
which is consistent with the behavior on Unix.

Pick-to: 6.2
Change-Id: I1cc551b7897fdba3cec1fd6705f5396790818c7d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-07-14 20:48:54 +03:00
Joerg Bornemann
72a90810cb CMake: Remove the usage of QT_SOURCE_TREE from tests
The ${QT_SOURCE_TREE}/src/network include paths of several tests are
apparently not needed anymore. Remove those.

tst_qfilesystementry and tst_qfreelist are the only tests that actually
need to reference files in qtbase's source tree. Simply use the paths
relative to the project file.

Task-number: QTBUG-88090
Change-Id: Ic6f341e001338c1b07dce6e58316245bc9560c5e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-07-12 18:56:14 +02:00
Alex Trotsenko
1a57a4974b QLocalSocket/Win: reimplement skipData() function
The base implementation discards the data by reading into a dummy
buffer, which is slower than necessary.

Change-Id: Iabf0c4a25746af6cac5b61d7bda66d89501c808c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-07-08 16:14:11 +03:00
Alex Trotsenko
03272e601c Clarify readLine() behavior on sequential devices
QIODevice::readLine() can also return partial lines, which was not
properly documented. Add an autotest for QLocalSocket to illustrate
and test this behavior.

Pick-to: 6.2
Change-Id: Ia2c1c438cc68d2672d34881e11fdf7837232f3b4
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-07-06 14:50:55 +03:00
Mårten Nordheim
87201ff712 tst_QDtls: Move the function declaration outside the function
With MSVC it tries to link with the function in the scope qt::tst_QDtls::*
where it is not found

Pick-to: 6.2
Change-Id: If83a9f69c7b3834248569f6bdf203f5442693080
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-07-02 13:05:32 +00:00
Mårten Nordheim
d33040548f QNetworkRequest: Rename (set)minimumArchiveBombSize
To (set)decompressedSafetyCheckThreshold, as suggested on the API review.

Task-number: QTBUG-94407
Change-Id: Iffc52691022939ae46703de8a0416355487b716f
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-07-02 13:05:32 +00:00
Marc Mutz
0ed1f8b54e tests: fix deprecated implicit capture of this via [=]
Fixes compiler warnings:
    warning: implicit capture of ‘this’ via ‘[=]’ is deprecated in C++20 [-Wdeprecated]

Change-Id: Ia7cf50f491e92f39162c69afb2a8320afedba056
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2021-06-30 23:13:28 +02:00
Mårten Nordheim
13cf86b2d1 tst_QSslSocket: Remove empty test functions
For flush() it's not clear what they wanted to test.
isEncrypted() is tested indirectly in many of the other tests.

Change-Id: Id6dfecbb25b7bba8f1a99518fd9c9e06280aaa9f
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-06-25 14:40:00 +02:00
Timur Pocheptsov
f7f2582c60 tst_qsslsocket: detect ALPN support (on server) using supportedFeatures()
Pick-to: 6.2
Change-Id: I30409667395bbe568823b8697dded41067a8346c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-06-25 08:01:55 +02:00
Mårten Nordheim
773b37fb38 tst_QSslSocket: Use supportedFeatures() instead of macro
It needs to be checked at runtime to know if the current backend
supports it

Pick-to: 6.2
Change-Id: I0998309149b109e2075a008b2b8d8115fa3688cc
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-06-24 23:30:47 +00:00
Mårten Nordheim
edc9a294a6 qopenssl_symbols: Change how we mark function unused
With MSVC the current way we mark it (potentially) unused ends up with a
warning:
warning C4551: function call missing argument list

We require c++17 core language support so let's use [[maybe_unused]]
instead.

Pick-to: 6.2
Change-Id: I125986b729cb7cd540901702a47365f0491e7887
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-06-24 23:30:47 +00:00
Mårten Nordheim
bb93c641a2 TLS: Mark TLS 1.0, 1.1 and DTLS 1.0 deprecated
As per the best practice laid forth in RFC-8996.
TLS 1.2 was recommended from 2008 until TLS 1.3 was released in 2018.

[ChangeLog][QtNetwork][QSslSocket] TLS 1.0, 1.1 and DTLS 1.0 are now
deprecated, as recommended by RFC-8996.

Fixes: QTBUG-92880
Change-Id: I90cebcfb07cfce623af7ac9f2b66ce9d02586b54
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-06-25 01:30:46 +02:00
Mårten Nordheim
664a6621fb QSslSocket: Set isEncrypted to false on disconnect
Since we're no longer connected, much less encrypted.
Was done in schannel backend, but not in ST or OpenSSL

Pick-to: 6.2
Change-Id: Ia49387be0088f899a0c89091f7e468dba1c0eee6
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-06-25 01:30:46 +02:00
Timur Pocheptsov
13ce568b76 tst_http2: use the supportedFeatures() instead of macros
With the recent change, 'system' headers gone: not in the test code anymore,
so, for example OPENSSL_VERSION_NUMBER is undefined, making the test
to select a wrong code-path - 'h2c', instead of encrypted h2.

Pick-to: 6.2
Pick-to: 6.1
Change-Id: I3b201e21fac56875c9045c7463e2ae69af4c6470
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-06-24 21:35:58 +02:00
Volker Hilsheimer
85121af2eb Fix compiler warning from unused parameter
Change-Id: I227b7188eddbad024dcced908c894925cee56591
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-06-23 15:06:33 +02:00
Edward Welbourne
a93a9ea915 Fix QFAIL() to interract correctly with QEXPECT_FAIL()
Previously, it went direct to QTestResults::addFailure() without going
via the checking for expected failure. Add QTestResults::fail() to
take care of this checking, as for verify() and compare().

Tidied up the code implementing expected failure and QFAIL(), while I
was about it. Adjusted an existing test to verify that expecting a
QFAIL() works, by using QFAIL() instead of QVERIFY(false).

Remove the QVERIFY(false) whose comment brought this to my attention.

[ChangeLog][QtTestLib][QFAIL] QEXPECT_FAIL() now correctly anticipates
a subsequent QFAIL(). Previously QFAIL() counted as a fail regardless.

Change-Id: Icc28cf70e5ff3006363791ea03aa01f2f591eb71
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-06-15 18:55:16 +02:00
Edward Welbourne
accdfbb396 Prefer QFAIL("Informative message") over QVERIFY(false)
Change-Id: I706b0aedfa870452331a8c2c488d55b279ee452a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-06-14 15:57:16 +02:00
Mårten Nordheim
6f25051536 QNetworkReply: Decompress when reading
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 <edward.welbourne@qt.io>
2021-06-12 00:04:04 +02:00
Timur Pocheptsov
6998ed4c96 Introduce a mini-version of qsslsocket_openssl_symbols_p.h/.cpp
For auto-tests that were temporarily disabled. Similar to
network-settings.h, header-only stuff.

Fixes: QTBUG-92866
Fixes: QTBUG-92877
Change-Id: I15b5c0b41f0d8bfe59b09c844884ff6d99e6d41a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-06-09 20:55:49 +02:00
Timur Pocheptsov
096b186004 tst_QNetworkReply::ignoreSslErrorsList, use the right error
The error that the actual runtime will encounter, and not the one that compile-time
ifdefs will (potentially) erroneously select.

Change-Id: I8ef4c34bcb8b3e568bc39f8c8ea6bfb7732f9e27
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-06-08 16:17:23 +02:00
Mårten Nordheim
14b74af060 QNetworkInformation: Adjustments to captive portal API
Make it return bool since the TriState was really only used signify that
the property was unsupported but there is already a separate way to
check if it's supported. More importantly there is no different set of
actions available to a user if they're in the Unknown or False state.

Because of the change to bool, we also rename the property to have an
'is'-prefix.

Change-Id: Iaaaad5ac31e663c36e00223bf5b0e719f412fc69
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2021-06-08 14:54:16 +02:00
Timur Pocheptsov
fd217e7f00 QDtls(Cookie) autotests - use the proper API to detect DTLS support
Instead of relying on some string comparisons and the current knowledge
of which backend supports DTLS, use the proper API we already have in
place to test if a particular class is supported by the active backend.

Change-Id: I58ca0f7b7fcef68ec375cd64b83e51d4335817da
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-06-03 20:08:32 +02:00
Timur Pocheptsov
eab0bb73a5 tst_QSslSocket::readBufferMaxSize() - workaround the flaky test
Task-number: QTBUG-94186
Change-Id: I8c82f1fede8f9512f531f4ff17508b9e71ebf0b7
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-06-03 17:05:44 +02:00
Mårten Nordheim
da955aadf5 QNetworkInformation: Behind captive portal
This patch adds the API, with no supporting backends

Task-number: QTBUG-93848
Change-Id: I50454717f928819e1b990df91872675e842f9987
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-05-31 17:25:22 +02:00
Mårten Nordheim
69982182a3 QNetworkRequest: Add API to set a minimum archive bomb size
Fixes: QTBUG-91870
Change-Id: Ia23e8b8bcfdf65a91fe57e739242a355c681c9e6
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-05-31 17:25:20 +02:00