summaryrefslogtreecommitdiffstats
path: root/src/network/kernel
Commit message (Collapse)AuthorAgeFilesLines
* Minor tidy-up: two sizetype fixes, two \nullptr usesEdward Welbourne2021-01-081-1/+1
| | | | | Change-Id: I6c4a1296350ecaf9a661dba22670fbb2ad23bd77 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove the qmake project filesJoerg Bornemann2021-01-071-95/+0
| | | | | | | | | | | | | | | | Remove the qmake project files for most of Qt. Leave the qmake project files for examples, because we still test those in the CI to ensure qmake does not regress. Also leave the qmake project files for utils and other minor parts that lack CMake project files. Task-number: QTBUG-88742 Change-Id: I6cdf059e6204816f617f9624f3ea9822703f73cc Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* macOS: Make sure that the reserved characters are not escapedAndy Shaw2020-12-041-1/+1
| | | | | | | | | | | | The URL for the PAC proxy that is passed needs to be preserved for the main URL part and not entirely percent encoded, only the query part typically needs to be encoded. So use toEncoded instead for a URL to ensure they are not percent encoded. This amends c163ec1dbf873781b77ea67d4449d643c166c0c4 Pick-to: 6.0 5.15 Change-Id: Ie41ab55f71be8e25c18775e61ce7b4d110c2ddbf Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Adjust code format, add space after 'if'Zhang Sheng2020-11-161-5/+5
| | | | | | Change-Id: Ice081c891ff7f4b766f49dd4bd5cf18c30237acf Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: hjk <hjk@qt.io>
* Fix reference of qt_attribution.json to license fileKai Koehne2020-11-161-0/+373
| | | | | | | | Amends 4f076db3d and 0ebda39e065 Change-Id: I307bb59acdfe00cf0ffe4f0f645152f2a8ba11a6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Update public suffix list header to latest versionEdward Welbourne2020-11-082-13994/+14327
| | | | | | | | | The former *.platform.sh entry has been replaced by more specific entries, replacing the wildcard with only selected second levels. Task-number: QTBUG-87925 Change-Id: Ie4ba7c66ba9aa40eafe23f02faa12f19d791cff2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Rename qurltlds-related files to match the header's moveEdward Welbourne2020-11-084-3/+32
| | | | | | | | | | | | | The header is now in src/network/kernel/ rather than src/corelib/io/, but the qt_attribution.json got left behind and the update program was still in a sub-dir of util/corelib/. Renamed the latter to util/publicSuffix/ (second-layer sub-directory was overkill, util/ isn't crowded and it was the only thing in util/corelib/; and there was no util/network/). This is a follow-up to commit 4f076db3d2e2e27cc56029fe878056ee79def56f Change-Id: I51c2c7892752ddc47390966044eb5650dfdfa9c2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Hide comparison of QHostAddress with SpecialAddress from ADLVolker Hilsheimer2020-10-302-9/+8
| | | | | | | | | Make global operators hidden friends. No change to the member-operators. Task-number: QTBUG-87976 Change-Id: If7b08a30700d4e2f1a304d4b6cc4b5d02ee5e251 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Another round of replacing 0 with nullptrAllan Sandfeld Jensen2020-10-071-2/+2
| | | | | | | | | This time based on grepping to also include documentation, tests and examples previously missed by the automatic tool. Change-Id: Ied1703f4bcc470fbc275f759ed5b7c588a5c4e9f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Android: rename Android's package name for Qt 6Assam Boudjelthia2020-10-032-2/+2
| | | | | | | | | | Rename Android package name org.qtproject.qt5.android to org.qtproject.qt.android to avoid inconsistency with Qt 6 name. Also, we include the major version number in the jar target. Task-number: QTBUG-86969 Change-Id: Ibb68947289be1079911b34ea157bf089cc52c47f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Replace Q_REQUIRED_RESULT with [[nodiscard]]Allan Sandfeld Jensen2020-09-251-7/+7
| | | | | | | It was already used many places directly making the code inconsistent. Change-Id: I3b14bc6c333640fb3ba33c71eba97e78c973e44b Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Skip IPv6 address if DAD failedTimur Pocheptsov2020-09-171-0/+3
| | | | | | | | | | Fixes: QTBUG-84256 Fixes: QTBUG-84253 Task-number: QTBUG-84254 Pick-to: 5.15 Change-Id: I6116c8a337cc85adbca1bbab2609d6627127fa46 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* 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>