]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
global: Ignore DNS callback result if it was aborted
authorAki Tuomi <aki.tuomi@open-xchange.com>
Thu, 6 Mar 2025 07:17:07 +0000 (09:17 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 7 Mar 2025 11:25:14 +0000 (13:25 +0200)
src/auth/auth-request.c
src/lib-dns-client/dns-lookup.h
src/lib-http/http-client-host.c
src/lib-imap-client/imapc-connection.c
src/lib-smtp/smtp-client-connection.c
src/lib-storage/index/pop3c/pop3c-client.c

index b81e65b4b8f722f539e4203cd0089d4f01a6816e..f7bf1fbfe2fd41ee1518acc8acabc5d75b31111c 100644 (file)
@@ -2357,6 +2357,9 @@ static void
 auth_request_proxy_dns_callback(const struct dns_lookup_result *result,
                                struct auth_request_proxy_dns_lookup_ctx *ctx)
 {
+       /* We ended up here because dns_lookup_abort() was used */
+       if (result->ret == EAI_CANCELED)
+               return;
        struct auth_request *request = ctx->request;
        const char *host;
        unsigned int i;
index 7df1786758eef7f223d5d04fd8f07eea304a84a2..6e58fcefa7547f689346913f07e2545ae40be04d 100644 (file)
@@ -2,6 +2,7 @@
 #define DNS_LOOKUP_H
 
 #define DNS_CLIENT_SOCKET_NAME "dns-client"
+#define EAI_CANCELED -101
 
 struct dns_lookup;
 
index 706c102e489a634f14c2331cf2497b0cf437213a..9135fd7259edbf13c85c5aba1986149f91b3c799 100644 (file)
@@ -115,6 +115,9 @@ static void
 http_client_host_shared_dns_callback(const struct dns_lookup_result *result,
                                     struct http_client_host_shared *hshared)
 {
+       /* We ended up here because dns_lookup_abort() was used */
+       if (result->ret == EAI_CANCELED)
+               return;
        struct http_client_host *host;
 
        hshared->dns_lookup = NULL;
index 491c6b25d11e94eb05d4b6c664e4bc83a4856811..e770944b5acaa07f2a422aeecfdd1a5245772c8d 100644 (file)
@@ -1889,6 +1889,9 @@ static void
 imapc_connection_dns_callback(const struct dns_lookup_result *result,
                              struct imapc_connection *conn)
 {
+       /* We ended up here because dns_lookup_abort() was used */
+       if (result->ret == EAI_CANCELED)
+               return;
        conn->dns_lookup = NULL;
 
        if (result->ret != 0) {
index 81a945bdd931f758559231346f7a62c51ee48d8e..f915896d517cfdff347008af096732456abfbe86 100644 (file)
@@ -1845,6 +1845,9 @@ static void
 smtp_client_connection_dns_callback(const struct dns_lookup_result *result,
                                    struct smtp_client_connection *conn)
 {
+       /* We ended up here because dns_lookup_abort() was used */
+       if (result->ret == EAI_CANCELED)
+               return;
        conn->dns_lookup = NULL;
 
        if (result->ret != 0) {
index e1326664e063d70563eac4e4ef1279d7cf52f973..0e1a2f43a0cda80cfdbc3a64b0dfb8a23179fa5b 100644 (file)
@@ -640,6 +640,9 @@ static void
 pop3c_dns_callback(const struct dns_lookup_result *result,
                   struct pop3c_client *client)
 {
+       /* We ended up here because dns_lookup_abort() was used */
+       if (result->ret == EAI_CANCELED)
+               return;
        client->dns_lookup = NULL;
 
        if (result->ret != 0) {