]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-dns: Add dns_client_has_pending_queries()
authorAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 10 Sep 2021 05:50:36 +0000 (08:50 +0300)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Mon, 17 Jan 2022 11:52:09 +0000 (13:52 +0200)
Needed for testing

src/lib-dns/dns-lookup.c
src/lib-dns/dns-lookup.h

index c37445e96a7dde7cc6b514b03b0f3a50701f91b6..bb247774a4f48538d74c7d8c0410675f6e71029a 100644 (file)
@@ -436,3 +436,8 @@ void dns_client_switch_ioloop(struct dns_client *client)
        for (lookup = client->head; lookup != NULL; lookup = lookup->next)
                dns_lookup_switch_ioloop_real(lookup);
 }
+
+bool dns_client_has_pending_queries(struct dns_client *client)
+{
+       return client->head != NULL;
+}
index 38d65f65b94a84b81b23e9766bfa828dda5e8512..8256d739a8f47a0ca1aa93c25f95f39010d200b8 100644 (file)
@@ -85,6 +85,9 @@ int dns_client_lookup_ptr(struct dns_client *client, const struct ip_addr *ip,
                        const struct dns_lookup_result *, typeof(context))), \
                (dns_lookup_callback_t *)callback, context, lookup_r)
 
+/* Returns true if the DNS client has any pending queries */
+bool dns_client_has_pending_queries(struct dns_client *client);
+
 void dns_client_switch_ioloop(struct dns_client *client);
 
 #endif