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

Commit b05b34d7 authored by martinwu's avatar martinwu Committed by Martin Wu
Browse files

Fix DnsResolver log print

When mDNS queries/send_dg() are timed out, the log prints out
"E resolv  : send_mdns: 1" which is not meaningful.

This commit changes the log print to "E resolv : send_mdns: timeout"
to provide an obvious message

Bug: 209492138
Test: checked the DnsResolver log
Change-Id: I07de9c4d2f10139debc3c9e76e625af616b9e076
parent 1f651757
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1141,7 +1141,7 @@ static int send_dg(ResState* statp, res_params* params, span<const uint8_t> msg,
            // Leave the UDP sockets open on timeout so we can keep listening for
            // a late response from this server while retrying on the next server.
            if (!isTimeout) statp->closeSockets();
            LOG(DEBUG) << __func__ << ": " << (isTimeout) ? "timeout" : "poll";
            LOG(DEBUG) << __func__ << ": " << (isTimeout ? "timeout" : "poll");
            return 0;
        }
        bool needRetry = false;
@@ -1233,7 +1233,7 @@ static int send_mdns(ResState* statp, span<const uint8_t> msg, span<uint8_t> ans
    if (retrying_poll(fd, POLLIN, &finish) <= 0) {
        *terrno = errno;
        if (*terrno == ETIMEDOUT) *rcode = RCODE_TIMEOUT;
        LOG(ERROR) << __func__ << ": " << (*terrno == ETIMEDOUT) ? "timeout" : "poll";
        LOG(ERROR) << __func__ << ": " << ((*terrno == ETIMEDOUT) ? "timeout" : "poll failed");
        return 0;
    }