Diffusion KIO 576b612e0d3e

[HostInfo] Set QHostInfo::HostNotFound when a host isn't found in the DNS cache

Authored by ahmadsamir on May 26 2020, 9:37 AM.

Description

[HostInfo] Set QHostInfo::HostNotFound when a host isn't found in the DNS cache

Here is the chain, AFAIU, in order:
LocalDomainUriFilter::exists()
KUriFilterPlugin::resolveName()
KIO::HostInfo::lookupHost()
HostInfo::lookupCachedHostInfoFor()

the latter would return a default constructed QHostInfo object, calling
error() on it would return QHostInfo::NoError, which is wrong since we
didn't find that host in the KIO DNS cache.

This made the KUriFilterTest::executables unit test fail when there's
something with the connection and both the DNS lookup times out and the
host can't be found the KIO cache.

Thanks to Ben Gruber in the bug report for figuring it out. I've
verified the whole sequence by following the code via gdb.

BUG: 421878

FIXED-IN: 5.71.0