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

Commit 090c48ea authored by Mike Yu's avatar Mike Yu Committed by Automerger Merge Worker
Browse files

Clean up expired DnsTlsDispatcher::Transport if DoT server list is empty am: 23d7371b

parents dc457577 23d7371b
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -111,7 +111,13 @@ DnsTlsTransport::Response DnsTlsDispatcher::query(const std::list<DnsTlsServer>&
    const std::list<DnsTlsServer> servers(
            getOrderedAndUsableServerList(tlsServers, statp->netid, statp->mark));

    if (servers.empty()) LOG(WARNING) << "No usable DnsTlsServers";
    if (servers.empty()) {
        LOG(WARNING) << "No usable DnsTlsServers";

        // Call cleanup so the expired Transports can be removed as expected.
        std::lock_guard guard(sLock);
        cleanup(std::chrono::steady_clock::now());
    }

    DnsTlsTransport::Response code = DnsTlsTransport::Response::internal_error;
    int serverCount = 0;