summaryrefslogtreecommitdiffstats
path: root/src/network/kernel
Commit message (Collapse)AuthorAgeFilesLines
* QAuthenticatorPrivate::parseHttpResponse: mark "host" as unusedMårten Nordheim2020-09-111-0/+3
| | | | | | | ... in the case where it is unused Change-Id: Ia181b975f07a8d1eee078867b98168ec5c326612 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QAuthenticator: condition using GSSAPI on credentials availabilityMårten Nordheim2020-09-112-12/+56
| | | | | | | | | | | | 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 <timur.pocheptsov@qt.io>
* QAuthenticator: move debug printing to a logging categoryMårten Nordheim2020-09-111-1/+5
| | | | | | | | | The GSSAPI thing is a bit noisy and not useful unless you're debugging it specifically. Pick-to: 5.15 Change-Id: I4a8c14159ec889776d06e0970ddf66083d788b63 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QAuthenticator: Don't reset phase on every set* callMårten Nordheim2020-09-111-11/+30
| | | | | | | | | | | | | | In QAuthenticator "detach()" does not do what you expect. First off it doesn't detach at all, and secondly it will reset the phase that the authentication is in. This last part is intended, but it has one issue: if setUser/setPassword is called with the same arguments every time we ask for credentials then we never reach a fail-state since it thinks we will have a new chance to authenticate. Pick-to: 5.15 Change-Id: I02e2e42242220f3fced3572323e6492429cf173e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QAuthenticator(Negotiate): Try provided credentialMårten Nordheim2020-09-101-4/+17
| | | | | | | | | | Windows only so far, need a similar patch for *nix, or an alternate approach when there is no server set up. Pick-to: 5.15 Task-number: QTBUG-85123 Change-Id: Iff7a6b1540a2f1984153a237eea07c7bb1970064 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QAuthenticator: Don't use Negotiate if unsupportedMårten Nordheim2020-09-101-0/+2
| | | | | | | | | If we compiled without support for it then we shouldn't consider it an option either. Pick-to: 5.15 Change-Id: If6e0a6afa738f375e360bf3d439196b39e47bee8 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Fix a number of MSVC integer conversion warningsFriedemann Kleint2020-09-101-1/+1
| | | | | | | | Mostly related to qstrlen(). Change-Id: I69e2052c83766e4fc466ed398d0d0eac011a77ec Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* qnetconmon: Downgrade Warning to DebugMårten Nordheim2020-08-281-1/+1
| | | | | | | | | It triggers when connecting to localhost (or when using socks proxy) and is nothing you can act on most of the time, so change it to qCDebug. Change-Id: I669fbde4fa0ed194703ea6a4dab13790aa771852 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Remove QFtp sources etc. in favor of alternate distributionMårten Nordheim2020-08-273-865/+0
| | | | | | | | | | | | While we initially wanted to just disable the functionality the way it is currently built forces people to do a full build of Qt just to enable it. Instead of doing this half-measure let's just remove the code completely from QtBase and rather prepare QtNetwork to handle being a plugin that can be compiled at any time. Task-number: QTBUG-80340 Change-Id: I19155c8c167cf932088f01b2a9706d0e7ab792d1 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* QHostInfo: address a Qt 6 todoMårten Nordheim2020-08-242-18/+16
| | | | | | | | Merged the two functions, required adding a friend declaration Change-Id: I86265da19e4b5f53d9e2dc54de3e252f0364225b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Use QMetaType in QMetaCallEventLars Knoll2020-08-241-3/+3
| | | | | | | And don't use int based type mapping anymore. Change-Id: I456e76d1933ef646a7bd39ce565886b89e938a44 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Deprecate the static int based API in QMetaTypeLars Knoll2020-08-241-3/+5
| | | | | | | | | | | | | And remove one of the type id to name mapping that still existed in QMetaType. QMetaTypeInterface can provide that, so there's no need to have a second copy of the data. qMetaTypeTypeInternal() can still map all the names of all builtin types to ids. That functionality is for now still required by moc and can't be removed yet. Change-Id: Ib4f8e9c71e1e7d99d52da9e44477c9a1f1805e57 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Replace Qt CONSTEXPR defines with constexprAllan Sandfeld Jensen2020-08-141-1/+1
| | | | | | | | Both normal and relaxed constexpr are required by our new minimum of C++17. Change-Id: Ic028b88a2e7a6cb7d5925f3133b9d54859a81744 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* QAuth.: Reset the nonce-count when the server requests using a new nonceMårten Nordheim2020-08-051-1/+3
| | | | | | | | | | | | Some servers have an upper limit on how many times a nonce can be reused. Because the nc was not being reset the server would get a high nc and would close the connection. Change-Id: I71d5a316f79777a45c7323d93e28b3845aefcfad Original-patch-by: Benjamin Reikowski Pick-to: 5.15 Fixes: QTBUG-85729 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QHostAddress: resolve API issues marked with ##Qt6Timur Pocheptsov2020-07-282-68/+2
| | | | | | | | Also, remove the deprecated function and its auto-test. Change-Id: If04a54c4b91e0f76523960c7b1a5bcb8fe883ac6 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add ; to Q_UNUSEDLars Schmertmann2020-07-073-12/+12
| | | | | | | | This is required to remove the ; from the macro with Qt 6. Task-number: QTBUG-82978 Change-Id: I3f0b6717956ca8fa486bed9817b89dfa19f5e0e1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Use qsizetype in QListLars Knoll2020-07-061-1/+1
| | | | | | | | | | | | | | | | | | | | The change creates a slight source incompatibility. The main things to take care of are * code using printf statements on list.size(). Using qsizetype in printf statements will always require a cast to work on both 32 and 64 bit. * A few places where overloads now get ambiguous. One example is QRandomGenerator::bounded() that has overloads for int, uint and double, but not int64. * Streaming list.size() to a QDataStream will change the format depending on the architecture. [ChangeLog][QtCore][QList] QList now uses qsizetype to index into elements. Change-Id: Iaff562a4d072b97f458417b670f95971bd47cbc6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* qnetworkproxy_mac - do not use the deprecated APITimur Pocheptsov2020-07-061-3/+10
| | | | | | | | | | CFURLStringByAddingXXX was deprecated, so we use QUrl combined with existing QString-based converters (from/to CFStringRef). Pick-to: 5.15 Task-number: QTBUG-83992 Change-Id: I6f1a3fdafa9532bb7816a1262169df3421169cb7 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Use QList instead of QVector in networkJarek Kobus2020-06-262-3/+3
| | | | | | Task-number: QTBUG-84469 Change-Id: I7827da68e73ca8ff1e599c836f2157894c452b63 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Fix living QLibrary member after shutdown of QCoreApplicationMike Achtelik2020-06-231-1/+19
| | | | | | | | | | | | LibResolv uses a QLibrary which is a QObject that must be deleted if the QCoreApplication is being destroyed to release the underlying library. A Q_GLOBAL_STATIC won't release any memory and is not able to manually release it. Pick-to: 5.15 Task-number: QTBUG-84234 Change-Id: I97fe5faca309e9c1e85435f602ad7f8c3f633b48 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix living QObject member after shutdown of QCoreApplicationAndré Klitzing2020-06-231-2/+19
| | | | | | | | | | | | | | QHostInfoLookupManager has a QThreadPool as member. QThreadPool is a QObject and must be deleted if the QCoreApplication is being destroyed to release the underlying ThreadData. A Q_GLOBAL_STATIC won't release any memory is not able to manually release it. Pick-to: 5.15 Task-number: QTBUG-84234 Change-Id: I96be4601c3af38fa7c753a6f7acb8273ee277a27 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QNAM: Make QNetworkConnectionMonitor able to move to another threadMårten Nordheim2020-06-224-14/+51
| | | | | | | | | | | | | | | | | Requires moving construction and destruction of the IConnectionPoint (contained in QNetworkListManagerEvents contained in QNetworkStatusMonitorPrivate) and the calls to CoInitialize and CoUninitialize to start()/stop() so it can be taken down and brought up in a reasonable way. Partial squashed cherry pick of bde6b27882143acbafa8c0b2e8055c3808ae3dd4 and the following fixup patch 84be436ef0f8253af87cdd2742858107e54c228b. Task-number: QTBUG-84031 Change-Id: I9d644261c6c730ea511e28d75da91bd34504bd03 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit bde6b27882143acbafa8c0b2e8055c3808ae3dd4) (cherry picked from commit 84be436ef0f8253af87cdd2742858107e54c228b)
* Port Q_STATIC_ASSERT(_X) to static_assertGiuseppe D'Angelo2020-06-194-8/+8
| | | | | | | | | | | | | | | | | There is no reason for keep using our macro now that we have C++17. The macro itself is left in for the moment being, as well as its detection logic, because it's needed for C code (not everything supports C11 yet). A few more cleanups will arrive in the next few patches. Note that this is a mere search/replace; some places were using double braces to work around the presence of commas in a macro, no attempt has been done to fix those. tst_qglobal had just some minor changes to keep testing the macro. Change-Id: I1c1c397d9f3e63db3338842bf350c9069ea57639 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Android: Add support for proxiesAndy Shaw2020-06-162-1/+123
| | | | | | | Pick-to: 5.15 Fixes: QTBUG-78812 Change-Id: Id1f35a5e4ca3d8841edae378df69b65ef599c1ca Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QtNetwork: Remove leftover deprecation macrosMårten Nordheim2020-06-122-30/+0
| | | | | | | These are no longer used Change-Id: I05a6e34975ee3fc6a704c074ebadacba34edf4aa Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Port QtNetwork from QStringRef to QStringViewLars Knoll2020-06-102-9/+9
| | | | | | | | Task-number: QTBUG-84319 Change-Id: I0f4e83c282b58ab4cc5e397b21981978f79d92cf Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QNetworkInterface (Unix): port two local tracker (QSet/QLVA) to ↵Marc Mutz2020-06-081-10/+9
| | | | | | | | | | | QDuplicateTracker Apart from a more fitting, minimal, API, QDuplicateTracker also transparently uses C++17 pmr::monotonic_buffer_resource to avoid, or at least reduce, memory allocations. Change-Id: I025504c7d22fb7a8c943e3968e4613d45c08d0b3 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Remove winrtOliver Wolff2020-06-065-429/+5
| | | | | | | | | Macros and the await helper function from qfunctions_winrt(_p).h are needed in other Qt modules which use UWP APIs on desktop windows. Task-number: QTBUG-84434 Change-Id: Ice09c11436ad151c17bdccd2c7defadd08c13925 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Convert Q_ASSERT to Q_STATIC_ASSERTDimitrios Apostolou2020-06-021-1/+1
| | | | | | | | This is now possible because of the earlier commit that changed the const arrays in qurltlds_p.h to constexpr arrays. Change-Id: I37a6a64e250bbe33f7d34b5916595bf6a37aed4a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Address Coverity defect about buffer overrunDimitrios Apostolou2020-05-281-3/+23
| | | | | | | | | | | | | | | | Coverity warned that chunk could be >= tldChunkCount (2), and tldData[chunk] (array of length 2) would be accessed out of bounds. This can not happen, but it was unclear. Clarify logic with comments and asserts, that Coverity will hopefully understand now. Change-Id: I2a38c685cfcbc69ed123918e8cbed360b20b1035 Coverity-Id: 178254 Pick-to: 5.15 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Regenerate qurltlds_p.hDimitrios Apostolou2020-05-281-13868/+13941
| | | | | | | | | | With the recent changes in the utility that generates it, it now has improved readability and constexpr arrays, usable in static asserts. It also has an updated list of TLDs. Change-Id: Ibdc986d667feebeb141ff81f6fddbc05b6be8488 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Sweep Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6 -> Q_DECLARE_SHAREDMarc Mutz2020-05-192-2/+2
| | | | | | | | | | | | This is Qt 6, so Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6 is the same as Q_DECLARE_SHARED. Let's hope we'll collectively get better at detecting missing Q_DECLARE_SHARED so we won't need a Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT7 in the future. Change-Id: I3da9faff4c66b64a3b257309012a2a10a6c6d027 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QAuthenticator: Reprioritize authentication methodsMårten Nordheim2020-05-191-1/+1
| | | | | | | | | | | | | | | | | | | The addition of Negotiate to QAuthenticator caused a soft sort of regression in environments where there is key distribution center set up. This was due to how QAuthenticator works in that it will simply prefer the latest entry in the enum, which now was Negotiate, which sadly wasn't really a valid option in that situation. And it is not smart enough to fall back and try another method. To work around this issue we re-order the enum to prioritize authentication methods to restore previous behavior. Note that Negotiate is still preferred over Basic and None because they're not likely to appear together. Pick-to: 5.15 Task-number: QTBUG-83905 Change-Id: Ic528318b6b711aa04d42a86c684452bb6ebde112 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Add a QRegularExpression::fromWildcard() convenience methodLars Knoll2020-05-062-4/+2
| | | | | | | | | Simplify constructing QRegularExpression objects from a glob pattern. Change-Id: I06f60b1dfea3da969e2474dedd44b6ca5d456d7d Reviewed-by: Simon Hausmann <hausmann@gmail.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-05-041-1/+7
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/text/qlocale.cpp src/network/access/qnetworkaccessmanager.cpp Regenerated tests/auto/testlib/selftests/float/CMakeLists.txt Change-Id: I5a8ae42511380ca49a38b13c6fa8a3c5df8bed01
| * QAuthenticator: make sure we load the SSPI libraryMårten Nordheim2020-04-301-1/+7
| | | | | | | | | | Change-Id: Iac371065dfc20ad5920889be66c8282a45c5805e Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | QNAM/QNetConMon: Update handling of QNetworkConnectionMonitor::startMårten Nordheim2020-04-301-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QNetworkConnectionMonitor::start was previously called after checking d->networkAccessible, unfortunately that means if the network was unavailable when QNetworkConnectionMonitor was created we don't subscribe to updates or recheck the status (unless QNetworkAccessManager::networkAccessible() is called). Move the call to start to before the offline check. Also update the Windows backend so that it updates networkAccessible on the call to start() Pick-to: 5.15 Change-Id: I37647f19f703947143e7cbdafe09619ce0d98cc1 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | QNetworkProxy: don't allocate when parsing [1/2]: loop bodyMarc Mutz2020-04-291-13/+17
| | | | | | | | | | | | | | | | | | | | | | | | Instead of manipulating a QByteArray, do it with a QLatin1String, which is free. Also, don't prepend a dot to force matches at label boundaries, check that there's a dot where the match occurred. Saves two allocations per iteration. Finally, pull the query's peerHostName() initialization out of the loop - it doesn't depend on the loop variable. Change-Id: I6dfdae711f0bd8941af69bfbcfda7873a40e4b80 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | Remove unused qTopLevelDomain()Marc Mutz2020-04-272-24/+0
| | | | | | | | | | | | | | The last (and only) user was removed in 4f076db3d2e2e27cc56029fe878056ee79def56f. Change-Id: I59b155017bfd00bbcbfe72dc0e535c92c0384dad Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | Port qIsEffectiveTLD() to QStringViewMarc Mutz2020-04-262-4/+6
| | | | | | | | | | | | | | | | | | Also add a piece of documentation that the input needs to be in lower-case (the implementation uses qt_hash to index into a table of TLDs, and qt_hash is case-sensitive). Change-Id: I911c0e2bb0826fc1b0fc01ed60bdfd6e4c0298f2 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-04-231-0/+2
|\| | | | | | | Change-Id: Iaa439ba7dff19a17e3716b3d30f49f60fa6e38f8
| * Merge remote-tracking branch 'origin/5.14' into 5.15Liang 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: Ib9151e199291fe6eb4151027b515393c05303d65
| | * 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>
* | | Port QNetworkProxy over to use QRegularExpressionLars Knoll2020-04-152-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | The windows and macOS implementations where still using QRegExp in one place. Change-Id: Iaf6c6ead10f7f061ff0edce889abe18751b9d308 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | Change qHash() to work with size_t instead of uintLars Knoll2020-04-092-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is required, so that QHash and QSet can hold more than 2^32 items on 64 bit platforms. The actual hashing functions for strings are still 32bit, this will be changed in a follow-up commit. Change-Id: I4372125252486075ff3a0b45ecfa818359fe103b Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | | QtNetwork: Delete bearer managementMårten Nordheim2020-04-053-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All remaining pieces are gone, configuration included. Relevant CMakeLists and configure.cmake were regenerated. Fixes: QTBUG-76502 Change-Id: I667b5da7e3802830d236d50b5e9190c2ee9c19e2 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Remove bearermanagement usage inside QNAM and QNetworkProxyMårten Nordheim2020-04-012-124/+0
| | | | | | | | | | | | | | | Change-Id: I2c4fdf598b46daf1b69a65848ebe0fd78ef8be24 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | Merge remote-tracking branch 'origin/5.15' into devSimon Hausmann2020-03-163-13782/+13916
|\| | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/kernel/qmetatype.cpp Change-Id: I88eb0d3e9c9a38abf7241a51e370c655ae74e38a
| * | QtNetwork deprecations: suppress internal warningsMårten Nordheim2020-03-122-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | 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-122-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | 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>