(james-jspf) 07/07: Fix another hang, handle all lookup exceptions from dnsjava

[email protected]
Newsgroups gmane.comp.jakarta.james.devel
Message-ID <[email protected]>
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-jspf.git

commit 71392966a4c6b02e9f3e1020ccb66786a3137007
Author: Emerson Pinter <[email protected]>
AuthorDate: Fri Feb 7 18:23:11 2025 -0300

    Fix another hang, handle all lookup exceptions from dnsjava
---
 .../java/org/apache/james/jspf/executor/AsynchronousSPFExecutor.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/resolver/src/main/java/org/apache/james/jspf/executor/AsynchronousSPFExecutor.java b/resolver/src/main/java/org/apache/james/jspf/executor/AsynchronousSPFExecutor.java
index b04e1f3..5560917 100644
--- a/resolver/src/main/java/org/apache/james/jspf/executor/AsynchronousSPFExecutor.java
+++ b/resolver/src/main/java/org/apache/james/jspf/executor/AsynchronousSPFExecutor.java
@@ -37,7 +37,7 @@ import org.apache.james.jspf.core.exceptions.TempErrorException;
 import org.apache.james.jspf.core.exceptions.TimeoutException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.xbill.DNS.lookup.NoSuchRRSetException;
+import org.xbill.DNS.lookup.LookupFailedException;
 
 /**
  * Asynchronous implementation of SPFExecutor. All queries will get executed asynchronously
@@ -91,7 +91,7 @@ public class AsynchronousSPFExecutor implements SPFExecutor {
                     if (e instanceof IOException && e.getMessage() != null && e.getMessage().startsWith("Timed out ")) {
                         e = new TimeoutException(e.getMessage());
                     }
-                    if (e instanceof NoSuchRRSetException) {
+                    if (e instanceof LookupFailedException) {
                         try {
                             DNSLookupContinuation dnsLookupContinuation = cont.getListener().onDNSResponse(new DNSResponse(new ArrayList<>()), session);
                             handleCont(session, result, dnsLookupContinuation, checker);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.