qt6-bb10/tests/auto/network/kernel
Volker Hilsheimer e24a4976be QHostInfo: Always post results through the event loop to the receiver
Lookups performed via QHostInfoRunnable must not synchronously call
the user-code's receiver objects, as that would execute user-code in
the wrong thread. Instead, post a metacall event through the event
loop of the receiver object, or the thread that initiated the lookup.

This was done correctly for the trivial cases of empty host name or
cached results, so the code generally existed. By moving it from a
global function into a member function of QHostInfoResult, we can
simply access the required data to construct and post the event.

As we process that posted event, we need to check that the context
object (which is already guarded via QPointer) is still alive, if
we had one in the first place. If we had one, and it's deleted, then
abort.

[ChangeLog][QtNetwork][QHostInfo] Functors used in the lookupHost
overloads are now called correctly in the thread of the context object.
When used without context object, the thread that initiates the lookup
will run the functor, and is required to run an event loop.

Change-Id: I9b38d4f9a23cfc4d9e07bc72de2d2cefe5d0d033
Fixes: QTBUG-76276
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-07-26 17:59:47 +02:00
..
qauthenticator Use qtConfig throughout in qtbase 2016-08-19 04:28:05 +00:00
qdnslookup Narrow tst_QDnsLookup::lookup blacklist to only CI 2018-04-04 05:05:51 +00:00
qdnslookup_appless Stop depending on test.macieira.org 2017-11-27 21:48:20 +00:00
qhostaddress QHostAddress: add more classification functions 2017-10-17 21:46:02 +00:00
qhostinfo QHostInfo: Always post results through the event loop to the receiver 2019-07-26 17:59:47 +02:00
qnetworkaddressentry Updated license headers 2016-01-21 18:55:18 +00:00
qnetworkdatagram Network: Use canonical license headers 2017-02-28 15:34:01 +00:00
qnetworkinterface tst_qnetworkinterface: Fix for case of zero interface 2018-07-06 06:39:36 +00:00
qnetworkproxy Updated license headers 2016-01-21 18:55:18 +00:00
qnetworkproxyfactory Merge remote-tracking branch 'origin/5.9' into 5.10 2017-10-04 13:41:04 +02:00
kernel.pro Use qtConfig throughout in qtbase 2016-08-19 04:28:05 +00:00