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

Commit 008122d1 authored by Mike Yu's avatar Mike Yu
Browse files

Don't log if resolv_gethostby{name,addr} return no error

To avoid log spam, log their return value if the value
is an error. The following logs won't be printed.

  GetHostByNameHandler::run: result: Success
  GetHostByAddrHandler::run: result: Success

Fix: 223115382
Test: adb shell ping dns.google, then check the log
Change-Id: I180936a2d66a47142726054f001281a7ecd56f00
parent b537dfdd
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -1159,7 +1159,9 @@ void DnsProxyListener::GetHostByNameHandler::run() {
    event.set_latency_micros(latencyUs);
    event.set_event_type(EVENT_GETHOSTBYNAME);

    LOG(DEBUG) << "GetHostByNameHandler::run: result: " << gai_strerror(rv);
    if (rv) {
        LOG(DEBUG) << "GetHostByNameHandler::run: result failed: " << gai_strerror(rv);
    }

    bool success = true;
    if (hp) {
@@ -1314,7 +1316,9 @@ void DnsProxyListener::GetHostByAddrHandler::run() {
    event.set_latency_micros(latencyUs);
    event.set_event_type(EVENT_GETHOSTBYADDR);

    LOG(DEBUG) << "GetHostByAddrHandler::run: result: " << gai_strerror(rv);
    if (rv) {
        LOG(DEBUG) << "GetHostByAddrHandler::run: result failed: " << gai_strerror(rv);
    }

    bool success = true;
    if (hp) {