X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fresolve%2Fresolved-bus.c;h=fba2afcc8d7838c6366686dbb8fde1d9d7b37ce6;hb=32a568fb90bf0a22a3007fa670305403a5d0bb72;hp=8161b5321fa3fe306fb51510700ce60c3ab84338;hpb=96aad8d15a324d0e956a4e5653a11a67b209b41a;p=elogind.git diff --git a/src/resolve/resolved-bus.c b/src/resolve/resolved-bus.c index 8161b5321..fba2afcc8 100644 --- a/src/resolve/resolved-bus.c +++ b/src/resolve/resolved-bus.c @@ -76,7 +76,7 @@ static int reply_query_state(DnsQuery *q) { rc = p; } - n = strappenda(_BUS_ERROR_DNS, rc); + n = strjoina(_BUS_ERROR_DNS, rc); sd_bus_error_setf(&error, n, "Could not resolve '%s', server or network returned error %s", name, rc); } @@ -183,7 +183,7 @@ static void bus_method_resolve_hostname_complete(DnsQuery *q) { } } - if (added <= 0) { + if (added == 0) { if (!cname) { r = sd_bus_reply_method_errorf(q->request, BUS_ERROR_NO_SUCH_RR, "'%s' does not have any RR of requested type", q->request_hostname); goto finish; @@ -220,6 +220,8 @@ static void bus_method_resolve_hostname_complete(DnsQuery *q) { added++; } + // what about the cache? + /* If we didn't find anything, then let's restart the * query, this time with the cname */ if (added <= 0) { @@ -398,7 +400,7 @@ static void bus_method_resolve_address_complete(DnsQuery *q) { } } - if (added <= 0) { + if (added == 0) { _cleanup_free_ char *ip = NULL; in_addr_to_string(q->request_family, &q->request_address, &ip);