Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0afffde5 authored by Lorenzo Colitti's avatar Lorenzo Colitti Committed by Automerger Merge Worker
Browse files

Don't call initDohLocked if there are no DoH servers. am: d68d651d

parents dc065357 d68d651d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -606,8 +606,6 @@ int PrivateDnsConfiguration::setDoh(int32_t netId, uint32_t mark,
    // Sort the input servers to prefer IPv6.
    const std::vector<std::string> sortedServers = sortServers(servers);

    initDohLocked();

    const auto& doh = makeDohIdentity(sortedServers, name, dohParams);
    if (!doh.ok()) {
        LOG(INFO) << __func__ << ": No suitable DoH server found";
@@ -615,6 +613,8 @@ int PrivateDnsConfiguration::setDoh(int32_t netId, uint32_t mark,
        return 0;
    }

    initDohLocked();

    auto it = mDohTracker.find(netId);
    // Skip if the same server already exists and its status == success.
    if (it != mDohTracker.end() && it->second == doh.value() &&