summaryrefslogtreecommitdiffstats
path: root/src/network
Commit message (Collapse)AuthorAgeFilesLines
* Doc: Remove manual duplicate alias descriptionsPaul Wicking2020-04-281-2/+0
| | | | | | | | | | With the introduction of the \typealias command to QDoc, QDoc generates a standardized line for aliased types. This patch removes duplication caused by the change in QDoc. Change-Id: I1a01c378f85b0decb7c0400a3b21146f0898c6ec Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Fix 32bit int overflowAllan Sandfeld Jensen2020-04-271-2/+5
| | | | | | | Do not continue if the conversion to 32bit int would cause an overflow. Change-Id: I8a198dce5962e7ebd248b9baa92aba8730bfd3b0 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Merge remote-tracking branch 'origin/5.14' into 5.15.0Liang Qi2020-04-221-0/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 3a6d8df5219653b043bd642668cee193f563ec84. That change is only for 5.14. Conflicts: src/plugins/platforms/wasm/qwasmeventtranslator.cpp src/plugins/platforms/wasm/qwasmintegration.cpp src/plugins/platforms/wasm/qwasmopenglcontext.cpp src/plugins/platforms/wasm/qwasmscreen.cpp Change-Id: I2d845c795a683e1542201cfb6fdd185fec2b17ab
| * QAuthenticator: Reset the authentication challengeMårten Nordheim2020-04-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | Both Negotiate and NTLM are conditioned on the 'challenge' being empty when starting the authentication process. So let's reset it when we start the authentication process. Fixes: QTBUG-83370 Change-Id: I41af6d5bcfe3dd980ca2bedce10ceff4f61047ff Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * OpenSSL: handle SSL_shutdown's errors properlyTimur Pocheptsov2020-04-166-7/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not call SSL_shutdown on a session that is in handshake state (SSL_in_init(s) returns 1). Also, do not call SSL_shutdown if a session encountered a fatal error (SSL_ERROR_SYSCALL or SSL_ERROR_SSL was found before). If SSL_shutdown was unsuccessful (returned code != 1), we have to clear the error(s) it queued. Unfortunately, SSL_in_init was a macro in OpenSSL 1.0.x. We have to resolve SSL_state to implement SSL_in_init. Fixes: QTBUG-83450 Change-Id: I6326119f4e79605429263045ac20605c30dccca3 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 8907635da59c2ae0e8db01f27b24a841b830e655)
* | Introduce QSocketNotifier::activate(QSocketDescriptor, QSN::Type)Mårten Nordheim2020-04-162-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pre-existing overload passes an int, but this can mean the descriptor gets truncated in compilations where the descriptor is 64-bit. The old overload with int is visible when querying the metaobject system so string-based connects still work as before, and connecting to it will produce a deprecation warning in the output. At the same time the PMF-based connect will, on recompile, pick the QSocketDescriptor overload. As an added improvement it also comes with the notification type, removing the need for separate slots where the code would be mostly shared anyway. The QSocketDescriptor type can be implicitly converted to and from qintptr to ensure existing code still compiles. It can also be constructed from Qt::HANDLE on Windows. In this same patch I also update the existing string-based connects in this module, which then includes updating the parameters for some slots as well. [ChangeLog][QtCore][QSocketNotifier] Added QSocketNotifier::activated(QSocketDescriptor, QSocketNotifier::Type). This replaces the activated(int) signal which in 64-bit environments could truncate the socket descriptor. If you use "activated" with the string-based connect() then you need to update the parameter type of the signal and slot if it had one. If you use it with the pointer to member function based connect() then all you need to do is update your slot's parameter type if it has one. If you need to compile your source code with multiple versions of Qt then connect() to this function using pointer to member function and update the slot's parameter type if needed. Task-number: QTBUG-70441 Change-Id: Ic43d6bc4c5bcb4040867b2ffad8d36fb01eed8af Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | OpenSSL: handle SSL_shutdown's errors properlyTimur Pocheptsov2020-04-155-7/+22
| | | | | | | | | | | | | | | | | | | | | | Do not call SSL_shutdown on a session that is in handshake state (SSL_in_init(s) returns 1). Also, do not call SSL_shutdown if a session encountered a fatal error (SSL_ERROR_SYSCALL or SSL_ERROR_SSL was found before). If SSL_shutdown was unsuccessful (returned code != 1), we have to clear the error(s) it queued. Fixes: QTBUG-83450 Change-Id: I6326119f4e79605429263045ac20605c30dccca3 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | H2C - make sure we send the client preface and settingsTimur Pocheptsov2020-04-073-0/+10
| | | | | | | | | | | | | | | | | | | | It's required as a response to upgraded protocol and apparently some servers would wait for it, not sending any frames. Becomes a problem in case only one request was sent. Fixes: QTBUG-83312 Change-Id: I90dc5c04095f0b78baa404466625d329dc4c6e21 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | macOS: Remove all use of deprecated Q_OS_OSX defineTor Arne Vestbø2020-04-033-6/+6
| | | | | | | | | | Change-Id: I49c285604694c93d37c9d1c7cd6d3b1509858319 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | wasm: refactor network to use fetch APILorn Potter2020-03-263-216/+132
| | | | | | | | | | | | | | | | | | | | This has better support for threaded use, and gets rid of bind use. This requires emscripten 1.38.37 and above Task-number: QTBUG-76891 Change-Id: Ic30a6820c2ce945c314751c06cfc356914a71217 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | More qOverload cleanups in qtbaseTimur Pocheptsov2020-03-242-2/+2
| | | | | | | | | | | | Task-number: QTBUG-82605 Change-Id: I1c3c14ed82911ed5483258c11e76f5dd7744fa12 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | Deprecation warnings: replace qrand with QRandomGeneratorVolker Hilsheimer2020-03-231-1/+2
| | | | | | | | | | Change-Id: I80fe6f611b367c6c8a1b77e82dc791493f88929b Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Merge "Merge remote-tracking branch 'origin/5.14' into 5.15"Mitch Curtis2020-03-231-1/+17
|\ \
| * | Merge remote-tracking branch 'origin/5.14' into 5.15Mitch Curtis2020-03-201-1/+17
| |\| | | | | | | | | | Change-Id: Ib2a2e3a292af43be3a980c2ccc943c08f4bbf72f
| | * q_getTimeFromASN1: fix invalid accessTimur Pocheptsov2020-03-191-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | No sanitizer is needed, just looking at the code is enough. It was wrong. Change-Id: I9df417c137d6b3361c3161865e099a8be40860de Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | | Fix the name in invokeMethodTimur Pocheptsov2020-03-231-4/+4
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-82605 Change-Id: If21d9c25d607e8a363fe703b4ffa1e2d207eef39 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | | OpenSSL: bump the minimum supported version to 1.1.1Giuseppe D'Angelo2020-03-202-3/+9
|/ / | | | | | | | | | | | | | | | | | | | | | | We don't support 1.0 any more, and 1.1.0 has reached EOL. Bump to 1.1.1 so we can freely use its APIs. [ChangeLog][QtNetwork][SSL] The minimum required version of OpenSSL is now 1.1.1. Change-Id: I5cfb6672fadfa48aedaefbcd6a954aa9eb85bfa5 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Move the default arguments of fromPath away from the deprecated overloadLars Knoll2020-03-191-11/+6
| | | | | | | | | | | | | | | | Move the default arguments to the overload that is not deprecated. This is fully source and binary compatible. Change-Id: I0d2eb491faf8c2164b80c33c4c4f749173b690f5 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | QtNetwork deprecations: suppress internal warningsMårten Nordheim2020-03-1210-4/+27
| | | | | | | | | | | | | | | | There're some uses we can't get rid of until the deprecated functions are deleted, so suppress them for now. Change-Id: I85b737eefc71f8f3ac939dfa961383220a8244af Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Bearer deprecation: centralize and suppress internal warningsMårten Nordheim2020-03-128-27/+24
| | | | | | | | | | | | | | | | We can't get rid of internal use, so let's work around that by not marking it deprecated in private code. Change-Id: If6cbfff4f16c30892335633567326141fbc44092 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Schannel: Fix readBufferMaxSize impl with incomplete data optimizationMårten Nordheim2020-03-101-1/+2
| | | | | | | | | | | | | | | | | | | | | | Following the incomplete data guesstimation optimization the tst_QSslSocket::readBufferMaxSize test would fail due to it waiting for 16K, but the readBufferMaxSize was 10 bytes. Amends 559b563d711db0760a51b0dce26536dbc8766a9d Change-Id: I5d17fac24e73c1305161aff744710b4c5b0b457a Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Bearer management deprecation cleanupMårten Nordheim2020-03-103-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | For QNAM: Deprecate the to-be-unused enum and mark the property deprecated in docs For bearermanagement: Add a warning on the bearermanagement documentation page that it is deprecated. Change-Id: I2cbe12ddec444d9f704601f07f3a7c9b70dc4f3c Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Document how to use CMake for Qt NetworkKai Koehne2020-03-096-25/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | Add documentation on how to use a module from CMake, alongside the existing documentation about qmake. While at it, also remove the mentioning of the central include; It is not something we should actively advocate anymore. Instead, the documentation of every class gives the correct include to use. Task-number: QTBUG-73058 Change-Id: I71ed5a62f4f0a6d868dd1f84ea39e5ac385a2fb8 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* | Document TlsV1SslV3 as deprecatedTimur Pocheptsov2020-03-041-1/+1
| | | | | | | | | | Change-Id: Id127b6d985d0085982e47b4f80886e3831ce07c7 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | QSslCertificate: Turn enum into enum class and expand abbreviationMårten Nordheim2020-03-043-8/+9
| | | | | | | | | | | | | | From API review Change-Id: Id174ff1a0a123585e41723ef1c1876b2f3bd39c5 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | QNetworkReply: Deprecate 'error' signal, use 'errorOccurred' insteadMårten Nordheim2020-03-035-6/+21
| | | | | | | | | | | | | | [ChangeLog][Deprecation Notice] QNetworkReply::error() (the signal) is deprecated; superseded by errorOccurred() Change-Id: I4f1ef410fd22d34ddf87e89cc5709cc60703af95 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | Deprecate public bearer classesMårten Nordheim2020-02-298-4/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The WARNING_PUSH/POP in QNetworkProxy is needed because it triggers a warning when compiled which means a warning gets printed under compilation which means tst_bic fails. [ChangeLog][Deprecation Notice][QtNetwork] QNetworkConfigurationManager, QNetworkConfiguration and QNetworkSession are deprecated, to be removed in Qt 6. Change-Id: Ife87722045ea10adf667388a1bf94c4f9bc8d5f0 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* | Use Qt::SplitBehavior in preference to QString::SplitBehaviorEdward Welbourne2020-02-284-5/+5
| | | | | | | | | | | | | | | | The Qt version was added in 5.14 "for use as eventual replacement for QString::SplitBehavior." Move another step closer to that goal. Change-Id: I399b5ea56e9255e775ca1746632f7421519a6616 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | Revert "QNetworkReply: deprecate the 'error' getter"Alexander Akulich2020-02-282-27/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit ccb2cb84f535b0bfce19a95d7f3a36803480cae8 and commit 0f568d0a671e9f0667a1b47ffa6fbb9f7a10d9f5. The patches fix ambiguity between a getter and a signal by changing the getter name, but we still have to rename the signal to follow the signals naming convention. Revert the commits to keep the getter as is and change the signal name instead. Change-Id: Iddbab7c33eea03826ae7c114a01857ed45bde6db Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | QAbstractSocket: deprecate 'error' signal, use 'errorOccurred' insteadAlexander Akulich2020-02-2713-34/+50
| | | | | | | | | | | | | | [ChangeLog][Deprecation Notice] QAbstractSocket::error() (the signal) is deprecated; superseded by errorOccurred() Change-Id: I11e9c774d7c6096d1e9b37c451cf0b99188b6aad Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Doc: Rename TransferTimeoutPreset to DefaultTransferTimeoutConstantMårten Nordheim2020-02-262-2/+2
| | | | | | | | | | | | | | | | | | A couple missed instances. Amends 0394961f953094ab3535b79329dace4ed9a0300d Change-Id: I41d47d1476c6688ca8a40b1ca62131891b9dec28 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Revert "QAbstractSocket: deprecate 'error' member-function"Alexander Akulich2020-02-2611-59/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 94b3dd77f29a00ebbd1efdc66d75f57e1c75b152. The patch fixes ambiguity between a getter and a signal by changing the getter name, but we still have to rename the signal to follow the signals naming convention. Revert the commit to keep the getter as is and change the signal name instead. Change-Id: I0dd60cf1ae9d1bd95beeb8ad58661ca4b1fb63b9 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Rename TransferTimeoutPreset to DefaultTransferTimeoutConstantTimur Pocheptsov2020-02-253-6/+6
| | | | | | | | | | | | | | | | | | Found in API review. Replacing with the suggested name which is more Qt-ish. And also preventively fix the name to contain its enum's name to follow the conventions. Change-Id: I00b510e36ccc831f107ecc3c79943d617726b4fb Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | QAbstractSocket: Use constructor delegationv5.15.0-beta1Alexander Akulich2020-02-221-6/+1
| | | | | | | | | | | | Change-Id: Ib749ff46dd3c9d44c1a3c6273eadd78fdf0f837e Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Friedemann Kleint2020-02-201-1/+1
|\| | | | | | | Change-Id: Ide8768d0d95aaeec943658aea27a03737d7dbf3f
| * Fix a typo in QLocalSocket docAlexander Akulich2020-02-181-1/+1
| | | | | | | | | | | | Change-Id: I3047cb24051c7f25d77d5b2b86ff145a52695107 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | QNAM Doc: Remove mention of bearerMårten Nordheim2020-02-193-47/+0
| | | | | | | | | | | | | | 🐻er management is going away Change-Id: I86067d593ece0d35a33f23130260ccb7c4b64881 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Liang Qi2020-02-187-9/+49
|\| | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qlinkedlist.h src/plugins/platforms/wasm/qwasmintegration.cpp src/plugins/platforms/wasm/qwasmscreen.cpp Change-Id: Iefca7f9f4966bdc20e7052aca736874861055738
| * QNAM: Correct logic of network monitor when bearer is disabledMårten Nordheim2020-02-141-1/+1
| | | | | | | | | | Change-Id: I0abe9034874a80423ad1e332404236dc5ff54365 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * QNetConMonitor(Win): Account for LOCALNETWORK reachabilityMårten Nordheim2020-02-141-7/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | What I originally thought NLM_CONNECTIVITY_IPV*_SUBNET meant turns out to be what NLM_CONNECTIVITY_IPV*_LOCALNETWORK is, leaving me to wonder when *_SUBNET is actually used. Anyway we now also check *_LOCALNETWORK to make sure we're not unnecessarily denying certain connections to be made. At the same time check for link-local connections where both local and remote are link-local, in this case even NLM_CONNECTIVITY_IPV*_NOTRAFFIC is valid. Unfortunately this check cannot be done in QNetworkStatusMonitor, so QNAM will likely not allow these connections. Task-number: QTBUG-80947 Change-Id: Ieb96ce9f4a478eef0c3ea47f2471f701c102b4d4 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * QTcpSocket::bind: fix issue found by BLACKLISTThiago Macieira2020-02-131-1/+2
| | | | | | | | | | | | | | | | | | | | | | The comment in QNativeSocketEnginePrivate::fetchConnectionParameters() talked about IPv6 v4-mapped addresses. However, toIPv4Address also converts the unspecified address (::), which resulted in QAbstractSocket saying that it had bound to QHostAddress::Any instead of QHostAddress::AnyV6 Change-Id: I572733186b73423b89e5fffd15f138579c5c0c50 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * Account for a reply that is finished before we can connect the signalsAndy Shaw2020-02-124-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In a case where a connection is refused, then it is possible for it to fail at the time that the QHttpNetworkReply is being created and therefore after the connections have been made it would have already emitted the signal to indicate it was finished with an error. To account for this, then it checks if there is an error code set on the reply and if there is then it will call the relevant slot right away. Fixes: QTBUG-57799 Change-Id: I4e73e5c82092c09f825343d18db40b47c3cdb9ac Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * Fix symbol resolving for OPENSSL_NO_NEXPROTONEGTimur Pocheptsov2020-02-051-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | Our ALPN-related definitions were conditioned both on OPENSSL_NO_NEXTPROTONEG and OpenSSL version (since ALPN first was introduced in 1.0.2), but resolving was only under version check, not OPENSSL_NO_NEXTPROTONEG. This went unnoticed for many years, and was found only recently with OpenSSL built with no-nexprotoneg. Fixes: QTBUG-81762 Change-Id: I7afca0b2034a234a19b5bcdefd3ce26f4202cddb Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | QLocalSocket: Deprecate 'error' signal, use 'errorOccurred' insteadv5.15.0-alpha1Alexander Akulich2020-02-115-12/+27
| | | | | | | | | | | | | | [ChangeLog][Deprecation Notice] QLocalSocket::error() (the signal) is deprecated; superseded by errorOccurred() Change-Id: I579c07564f5c470cf2867864755e0a26e6afce3b Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | QLocalSocket: Rename private errorOccurred method to setErrorAndEmit()Alexander Akulich2020-02-113-21/+21
| | | | | | | | | | | | | | | | | | | | | | | | The method named like a signal and can lead to confusion especially if such a signal will be added. The new name taken from QAbstractSocketPrivate::setErrorAndEmit(), though in QLocalSocket the method is NOT the only place of the error set and the signal emission. Change-Id: I7cdc487a39ec290203cced7359527f888342a0ad Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | Revert "QLocalSocket - deprecate ambiguous 'error' overloads"Alexander Akulich2020-02-115-46/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 0de6c26ac17c90f513329fdbe87ef036fc25925a. The patch fixes ambiguity between a getter and a signal by changing the getter name, but we still have to rename the signal to follow the signals naming convention. Revert the commit to keep the getter as is and change the signal name instead. Change-Id: I67dbb5cada25da473bdd02e71b1e2d9bd03f039e Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | Merge "Merge remote-tracking branch 'origin/5.14' into 5.15"Qt Forward Merge Bot2020-02-041-1/+1
|\ \
| * | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-02-041-1/+1
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf examples/widgets/widgets/imageviewer/imageviewer.cpp src/corelib/text/qchar.cpp src/corelib/time/qdatetime.cpp Change-Id: I9762f5c4ff650799219729d6aee79ac07ce9024a
| | * Fix 'the the' typo in commentsLinus Jahn2020-02-021-1/+1
| | | | | | | | | | | | | | | Change-Id: I00fcb1c2374e7ca168b6240f9d41c0323fb0867c Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | | Doc: Make snippets Qt Network compilableNico Vertriest2020-02-042-2/+7
|/ / | | | | | | | | | | Task-number: QTBUG-81489 Change-Id: I43446c7dafe60bc735fe463f359467b889952082 Reviewed-by: Paul Wicking <paul.wicking@qt.io>