summaryrefslogtreecommitdiffstats
path: root/src/network/kernel
Commit message (Collapse)AuthorAgeFilesLines
* Network: Add Q_GADGET to types exposed in signals and slotsUlf Hermann2 days3-0/+3
| | | | | | | | | | | In order to build a complete graph of metaobjects via properties and methods we need to know about all argument and return types as metaobjecs. Such a graph is desirable for reasoning about the consistency of the type system. Task-number: QTBUG-101143 Change-Id: Ic4e2f58a4275df06178437c6d45270f3f2aa5ce6 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QNetworkInterface[unix]: fixup some memcpysMårten Nordheim14 days1-3/+6
| | | | | | | | | | | | | There is an untested config for enabling null-strings, so technically not supported. But if we ever want to make null mean null then we should protect against it. Also drop the explicit template argument for qMin. This means we use the hetereogeneus version which will promote to size_t. Which is the type that memcpy expects anyway. Change-Id: I91e0a3b159b065b76e9e93605ef0e502f41af74f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Network: cleanlinessMårten Nordheim14 days2-6/+6
| | | | | | | | | QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_BYTEARRAY QT_NO_URL_CAST_FROM_STRING Change-Id: Ic77ed8ccbdb146b7e7b26123923795f9748d3a38 Reviewed-by: Mate Barany <mate.barany@qt.io>
* Network: Use QHttpHeaders in QHttpHeaderParserLena Biliaieva2024-01-252-14/+13
| | | | | | | | | | | | | 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 <ievgenii.meshcheriakov@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
* QHostInfo: fix lookupHost() signature immediatelyMarc Mutz2024-01-232-2/+8
| | | | | | | | | | | | | | | ... and not just for Qt 7. Found in API-Review. Amends dd50d58af267bd3b79d1ca31b920d72b925d5a37. [ChangeLog][QtNetwork][QHostInfo] The lookupHost() static function now takes const QObject* receivers (was: (non-const) QObject*). Pick-to: 6.7 Change-Id: I22b11e06cfba4e96975239cabed8b379cf3f4fa4 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Fix QThreadPool::maxThreadCount() usageIvan Solovev2024-01-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | The docs claim that QThreadPool always creates at least one thread. However, the user can (usually by mistake) request zero or a negative number of threads. The maxThreadCount() function is simply returning the value, that was requested by the user. Since it's a public API, it is used in several places in QtConcurrent, where it is assumed that the value is always positive. This can lead to a crash if the user sets zero as a maxThreadCount. Update all such places with std::max(maxThreadCount(), 1). Prefer this approach over changing the return value of maxThreadCount(), because its behavior is documented and tested. Amends 885eff053797d56f2e295558d0a71b030fbb1a69. Fixes: QTBUG-120335 Pick-to: 6.7 6.6 6.5 6.2 Change-Id: Id3b2087cec7fbc7a2d42febca6586f2dacffe444 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove the use of Q_NETWORK_PRIVATE_EXPORTAlexey Edelev2023-12-221-1/+0
| | | | | | | Task-number: QTBUG-117983 Change-Id: I2339dc96b49aba38169ad3e84f48c9d3c97d6117 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* network: use CIS compare moreAnton Kudryavtsev2023-11-011-4/+4
| | | | | | | to reduce allocations Change-Id: I648518fd152a834bbdc6afcedb693f02c1b13af1 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QNetworkInfo: if no builtin defaults are found, load anythingMårten Nordheim2023-10-311-9/+22
| | | | | | | | | | | | | As a fallback before picking the dummy backend. [ChangeLog][QtNetwork][QNetworkInformation] QNetworkInformation::defaultBackend() will now load any available backend with Reachability support if the default ones are not available. If none are available it will create a backend that always returns the default values for each property. Change-Id: I40889eeb51929e81f77ec2d84999932b095baf0b Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QNetworkInfo: Simplify flags checkMårten Nordheim2023-09-261-1/+1
| | | | | Change-Id: I5e369b9cd2b3abc6c0ac1e632e495b05c506980b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* JNI: replace TYPE declarations with CLASS declarationsVolker Hilsheimer2023-09-201-1/+1
| | | | | | | | | | | | | That we have two macros to declare a C++ type to represent a Java class is confusing. The TYPE macro as of now allows us to declare array types, but with QJniArray we won't need that anymore, and can just use Class[] as the type instead. Changing that will be a follow-up commit; for now, get rid of TYPE-usages to declare regular classes. Change-Id: Iea0a9548772ca701148442412cf6ad567583213f Reviewed-by: Zoltan Gera <zoltan.gera@qt.io> Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* QNetworkConnectionEvents: fix potential nullptr accessVladimir Belyavsky2023-09-181-0/+6
| | | | | | | | | | | | Fix potential nullptr access in QNetworkConnectionEvents::getNetworkConnectionFromAdapterGuid(). This can happen if for some reason the NetworkListManager instance failed to be instantiated in QNetworkConnectionEvents constructor. Fixes: QTBUG-117097 Pick-to: 6.6 6.5 Change-Id: If51ea383e22461a6c3124576c4e1be3f30dde1f6 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QNetworkInterface: replace CMake check for ifr_index with SFINAEThiago Macieira2023-09-091-16/+14
| | | | | | | | Detecting if a member exists is very easy and saves us from running the test at CMake time. Saves about 350 ms. Change-Id: I2b24e1d3cad44897906efffd178007fdcdd18e37 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QHostInfo::lookupHost: do not violate lookupHostImpl preconditionsGiuseppe D'Angelo2023-09-081-0/+4
| | | | | | | | | | | | | lookupHostImpl requires either `receiver` or `slotObj` to be non-null. Since this code path deals with the string-based slots, `slotObj` is going to be null, therefore check that `receiver` is non-null. For completeness: also check that `member` is non-null. Emit a warning (à la QObject::connect) in case the user did something wrong. Change-Id: Ic6dcd51d7ddd977b121484369b1aef48844364c5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QHostInfo::abortLookup: ignore -1Giuseppe D'Angelo2023-09-071-0/+3
| | | | | | | | | | The id -1 is the one of a default-constructed QHostInfo (invalid). It's also returned by various codepaths to mean a lookup failure. Attemping to abort its lookup should simply be ignored. Change-Id: I0413dd248a890f57195e4f5b5baea011b6737102 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* network: use string view types moreAnton Kudryavtsev2023-09-061-1/+1
| | | | | | | Prefer QLatin1StringView overloads Change-Id: I23846761f2c93021de4f6e6b7eba1d74045f89a1 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* qnetworkproxy[libproxy]: Add missing includeMårten Nordheim2023-09-061-0/+1
| | | | | | | | | | Amends cda98280edd2ab7b8d6b3dee08281b045c470dc5 Pick-to: 6.6 Fixes: QTBUG-116758 Change-Id: I337d946a054eb9c9e2f6ec9e8af40694b37afe12 Reviewed-by: André Klitzing <aklitzing@gmail.com> Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
* Add dummy backend to QNetworkInformationMate Barany2023-09-061-1/+33
| | | | | | | | | | The integration of QTBUG-113813 has failed because at the moment there is no network information backend for QNX. Implement a simple dummy backend to handle these cases. Task-number: QTBUG-113813 Change-Id: Id6fa3e590c43b0125d82e8680733e30788d9894e Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QHostInfoResult::postResultsReady: streamline the implementationGiuseppe D'Angelo2023-09-062-32/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QHostInfo's lookup can notify a slot specified either via the string-based SLOT or via PMF/function objects. In the first case, an actual connection is established and a signal is emitted carrying the result object. In the PMF case, QHostInfo does not establish a connection and calls the slot object "directly" (using some private QObject APIs). The implementation was (and still somehow is) quite convoluted: the index of the QHostInfoResult signal to be emitted was looked up, and used to create a metacall event. However the metacall event was also intercepted in an override of event(), and from there the slot was called. But we don't need to look the signal index up at all to do that, since we are actually never emitting the signal! This can be done with a custom event. ... but I'm not doing that as that's reinventing the wheel. Instead, I'm using invokeMethod to call a private function of QHostInfoResult, and from there we can invoke the slot object. This allows us to get rid of the signal index lookup, remove the manual metacall event handling, and the copy() kludge for SlotObjUniquePtr. Change-Id: I2193acdad57788efd5250bd29f7a1c7505eed2f1 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QHostInfoResult: use the same semantics as the contextless connect()Giuseppe D'Angelo2023-09-062-11/+14
| | | | | | | | | | | | | | | | | | | | | The 3-arg QObject::connect() overload (the "contextless" one) simply forwards to the 4-arg overload, using the sender object as both the sender and the receiver/context. QHostInfo does not use connect() directly in order to emit notifications that a lookup is finished. Instead, it uses some of QObject private plumbing. When handling a lookup request that specifies a function to call when done, but no context object, QHostInfo passes nullptr as context/receiver. Change QHostInfoResult's behavior to always have a "receiver": in case the caller didn't specify one, use `this` (= the sender). As a drive-by, this allows to streamline some code. Change-Id: Ic2e63ac18ba36269036950b6f6b7fecea51d0c99 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QHostInfo: add a Qt 7 noteGiuseppe D'Angelo2023-09-062-2/+2
| | | | | Change-Id: I45ee4eba1f7ded358acaccf678e4e12a006b91b6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QHostInfo::lookupHostImpl: code tidiesGiuseppe D'Angelo2023-09-051-4/+9
| | | | | | | | | | | Since a non-null `member` implies a non-null `receiver`, streamline the redundant check(s). While at it, introduce a simple boolean that conveys the meaning of what we're checking for. Change-Id: Ib9be162075771de74b1a6bc4426008b7c194df3a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QHostInfo::lookupHostImpl: add another precondition checkGiuseppe D'Angelo2023-09-051-0/+1
| | | | | | | | | | If `member` is set it means that the caller wants us to connect to a slot using string-based connections. That means `receiver` must be non-null as well. Check for it. Change-Id: I6b3542855147e95fecbf4c645b556c2047a1ed69 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QHostInfo::lookupHost: enable QT_NO_CONTEXTLESS_CONNECTGiuseppe D'Angelo2023-09-051-0/+2
| | | | | | | | | | | | QHostInfo::lookupHost uses some QObject private APIs in order to have a invoke a slot/function when the lookup is finished. The overload that simply takes a function (and not a context object) was still available even under QT_NO_CONTEXTLESS_CONNECT, because indeed the implementation bypasses the public QObject::connect API. Hence, explicitly the overload that doesn't take a context object. Change-Id: Ibf5b0efc49b7f9c8d045862ae061f4e05ee1b769 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Tidy up QAuthenticatorPrivate::calculateResponseAnton Kudryavtsev2023-09-041-2/+1
| | | | | | | | call toBase64() with temp value Change-Id: Idedfd91f60900ec51923803a6bb9ed6631e64d94 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* qauthenticator: use QBAV moreAnton Kudryavtsev2023-09-041-3/+2
| | | | | Change-Id: Iaa208785f6e1dc8eb5f32ab5e099c8df277bb2f1 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* qauthenticator: reduce allocations in parseHttpResponseAnton Kudryavtsev2023-09-041-14/+14
| | | | | | | by QBAV usage. While touching code, port index based loop to range based Change-Id: I06a784b94678b901d1074cca224c926e8534bd8e Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Fix living QLibProxyWrapper after shutdown of QCoreApplicationAndré Klitzing2023-09-011-1/+1
| | | | | | | Pick-to: 6.6 Task-number: QTBUG-84234 Change-Id: I8f5e2947b6529a0a8871d040050205934ee60354 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QHostInfo::localDomainName: use QBAV moreAnton Kudryavtsev2023-09-011-6/+9
| | | | | | | to reduce allocations Change-Id: If75c3818333880ba34f2e58038b05869979ae14d Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QAuthenticator: replace split with tokenizeAnton Kudryavtsev2023-08-271-2/+10
| | | | | | | to avoid needless allocations Change-Id: I39eb90ef073db5359e7a559e33233b1e75b7461c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QHostAddress::toString: use QSB moreAnton Kudryavtsev2023-08-271-1/+1
| | | | | Change-Id: Id7d9675c5a8dd09d0edaaa34a28a07fead068109 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* CMake: modernize ipv6ifname and getifaddrs config checks with QT_CONFIGThiago Macieira2023-08-251-10/+6
| | | | | | | | | | | I've left the QT_NO_ macros because they were public. No one should be using them (and they are now 1 on Linux, so you had better not be using them), but just in case. Change-Id: Ifbf974a4d10745b099b1fffd177758a7a26e4244 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QAuthenticator: postpone creation of QBAAnton Kudryavtsev2023-08-251-2/+2
| | | | | | | | Create QBA only when it's needed While touching code, use std::move more Change-Id: I5f014822a47d41fa1fca46a85a7921c70d1d9a55 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QAuthenticator: use QSB moreAnton Kudryavtsev2023-08-251-1/+1
| | | | | | | avoid temp allocations Change-Id: I8ca4d4b748f79d1c7a4455a5105998c58c91c7a4 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Add Q_CLASSINFO to QNetworkInformationMate Barany2023-08-241-0/+1
| | | | | | | | | | | As part of creating the QML binding, add Q_CLASSINFO("RegisterEnumClassesUnscoped", "false") to QNetworkInformation. Task-number: QTBUG-113813 Change-Id: Ib5d3b2356986c565b9786bc2d925cc4199bae6c9 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QHostInfo: remove usused -Result and -Runnable ctorsMarc Mutz2023-08-182-18/+0
| | | | | | | | | Clean up after all users are ported to the SlotObjUniquePtr overloads. Pick-to: 6.6 6.5 Change-Id: I3e58249296ea9674c45fb412463ae3201518de72 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QHostInfo: add -Result and -Runnable ctors taking SlotObjUniquePtrMarc Mutz2023-08-182-4/+22
| | | | | | | | | | | | | | | | ... and use them around the code. Avoids the impedance mismatch between users, which .release() their SlotObjUniquePtr's into the ctors, and the ctor, which constructs its member SlotObjUniquePtr from that. The old constructors are left in on purpose and removed in a follow-up commit to facilitate cherry-picking into branches that might have additional callers. Pick-to: 6.6 6.5 Change-Id: I6f8bce317d5116296973a3a2e3f97db1451f579d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Deprecate Q_ASSUME()Thiago Macieira2023-08-141-1/+1
| | | | | | | | | | | | | | | | | | | | We've known for a long time that this is producing worse code with GCC because of how we implemented in Q_ASSUME_IMPL(). So bite the bullet and actually deprecate the macro, replacing all extant Q_ASSUME() with Q_ASSERT(). The replacement is in C++23. Backporting the support onto Q_ASSUME_IMPL was previously rejected by reviewers. [ChangeLog][Deprecation Notice] The Q_ASSUME() macro is deprecated. This macro has different side-effects depending on the compiler used (GCC compared to Clang and MSVC), and there are certain conditions under which GCC is known to produce worse code than if the macro was absent. To give a hint to the compiler for optimizations, use the C++23 [[assume]] attribute. Change-Id: I80612a7d275c41f1baf0fffd177a3a4ad819fb2d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QHostInfo: port lookupHostImpl() to SlotObjUniquePtr internallyMarc Mutz2023-08-141-12/+9
| | | | | | | | | Avoids the manual deref'ing. Pick-to: 6.6 6.5 Change-Id: I1a51a468dfa704986f050b29322a424dc6fcd7b7 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Make QNetworkInformation thread safeMate Barany2023-08-142-9/+41
| | | | | | | | | | | | | | The current implementation is not thread safe - it is possible to update and query the network information without any locking. Protect the internals of the backend with a lock and move the object to the main thread. Task-number: QTBUG-115748 Change-Id: I9511fc3522ae82cffca42abc54eb79cb156397c4 Reviewed-by: Juha Vuolle <juha.vuolle@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QHostInfo: use new QMetaCallEvent::create() overloadMarc Mutz2023-08-101-1/+1
| | | | | | | | | | Move the SlotObjUniquePtr directly into the QMetaCallEvent, without having to up and down the ref-count. Pick-to: 6.6 6.5 Change-Id: I029f71c60defce71ac8778547efe999ce0cf7b4b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QHostInfo: de-inline -Result and -Runnable dtorsMarc Mutz2023-08-072-0/+10
| | | | | | | | | | | | These classes are not exported, so we don't run into duplicate vtables here, but the header is included in a few TUs other than qhostinfo.cpp (all, when building with PCH), so make sure we compile dtors only once. Pick-to: 6.6 6.5 Change-Id: I51f6a6d27fc084ad469f82dc7aef3327bdd9a906 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Add copy(SlotObjUniquePtr), use it in QHostInfoResult & SlotObjSharedPtrMarc Mutz2023-08-061-3/+1
| | | | | | | | | | | | It's a free function, because a) it rhymes with move(ptr) and, of course, SlotObjUniquePtr being a std::unique_ptr, b) we can't add member functions to it (and no, inheriting from a type whose dtor is neither protected nor virtual is nothing you will catch yours truly doing). Pick-to: 6.6 6.5 Change-Id: I2026126857a7bba204d683bad118e8a2c5cb2924 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* QHostInfo: use SlotObjUniquePtrMårten Nordheim2023-08-062-10/+4
| | | | | | | | | Drops the direct deref'ing. Pick-to: 6.6 6.5 Change-Id: I9f159244d50572659fa8e9cabfbef47e769ac54e Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QHostInfo: fix remaining slotObj leaksMarc Mutz2023-08-041-0/+4
| | | | | | | | | | | | | | | | | | | | | | | We failed to delete the slot object when lookUpHost() was called in these (exceptional) circumstances: - on a thread with no event dispatcher - after application shut-down, when the QHostInfoLookupManager Q_APPLICATION_STATIC was destroyed already Fix by adding the missing destroyIfLastRef() calls into these code paths, too. Amends ad5eb297e179a164e297a7c2eb3b9674a1196605. This would be so much easier if we had SlotObjUniquePtr... Pick-to: 6.6 6.5 6.2 5.15 Task-number: QTBUG-115263 Change-Id: Ief8bf125bc196742c0ce59c1fd87ab93242fc0da Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Don't include resolv.h when libresolv is disabledJacek Poplawski2023-07-261-1/+4
| | | | | Change-Id: I5b216ed02452549b69847b34139613669905023c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QHostInfo: fix leaking slot objectMårten Nordheim2023-07-192-1/+8
| | | | | | | | | | | | We were not ref'ing or deref'ing the slot object in the various places that owned it. So, if, in the end, the QHostInfoResult object didn't call the slot we would leak the slot object. Pick-to: 6.6 6.5 6.2 5.15 Fixes: QTBUG-115263 Change-Id: I45f43756c7589470045d97b59257ccfd85a325b7 Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QNetworkInterface/Linux: fix mismatch of pointer and pointeeThiago Macieira2023-07-111-3/+6
| | | | | | | | | | | | | | | | | It was hard to see the problem because of the lambda, combined with reinterpret_cast on the output of non-typesafe C macro. NLMSG_DATA returns a void*, so use static_cast to be sure not to do something wrong. This only affected the code that dealt with unexpected replies from the Linux kernel, which it doesn't send. So I don't expect this fixes any improper QNetworkInterface behavior. Found by CodeChecker. Pick-to: 6.5 6.6 Change-Id: I61b74deaf2514644a24efffd1770d75e5a4f2636 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QDnsLookup/Unix: cache previously decoded domain namesThiago Macieira2023-06-031-3/+29
| | | | | Change-Id: I5f7f427ded124479baa6fffd175f3ce37f0e49aa Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QDnsLookup/Windows: add a simple decoded domain cacheThiago Macieira2023-06-031-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid decoding multiple times the domain name when it comes in sequence. This happens when a given domain label either has multiple entries in its record set or when it's a CNAME (or both), such as in: ;; ANSWER SECTION: cname-cname.test.qt-project.org. 3600 IN CNAME cname.test.qt-project.org. cname.test.qt-project.org. 1614 IN CNAME multi.test.qt-project.org. multi.test.qt-project.org. 1614 IN A 198.51.100.2 multi.test.qt-project.org. 1614 IN A 198.51.100.3 multi.test.qt-project.org. 1614 IN A 198.51.100.1 Label targets from other records such as MX and SRV usually do show up again, in the Additional section, but the chance that they are sequential isn't very good, so we don't cache those. ;; ANSWER SECTION: mx-multi.test.qt-project.org. 3354 IN MX 10 multi.test.qt-project.org. mx-multi.test.qt-project.org. 3354 IN MX 20 a-single.test.qt-project.org. ;; ADDITIONAL SECTION: multi.test.qt-project.org. 1145 IN A 198.51.100.3 multi.test.qt-project.org. 1145 IN A 198.51.100.1 multi.test.qt-project.org. 1145 IN A 198.51.100.2 a-single.test.qt-project.org. 3364 IN A 192.0.2.1 Change-Id: I5f7f427ded124479baa6fffd175f5cf88939ee73 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>