From e9930948611bc7e5c5681ffdb5268ac853a708bc Mon Sep 17 00:00:00 2001 From: weijun Date: Thu, 27 May 2010 17:24:40 +0800 Subject: [PATCH] 6955783: ServiceUnavailableException caught even the secondary DNS is available Reviewed-by: vinnie --- src/share/classes/com/sun/jndi/dns/DnsClient.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/share/classes/com/sun/jndi/dns/DnsClient.java b/src/share/classes/com/sun/jndi/dns/DnsClient.java index 790077a4f..19bd6df3a 100644 --- a/src/share/classes/com/sun/jndi/dns/DnsClient.java +++ b/src/share/classes/com/sun/jndi/dns/DnsClient.java @@ -525,11 +525,11 @@ public class DnsClient { } byte[] pkt; if ((pkt = (byte[]) resps.get(xid)) != null) { + checkResponseCode(new Header(pkt, pkt.length)); synchronized (queuesLock) { resps.remove(xid); reqs.remove(xid); } - checkResponseCode(new Header(pkt, pkt.length)); if (debug) { dprint("FOUND (" + Thread.currentThread() + @@ -562,12 +562,12 @@ public class DnsClient { dprint("XID MATCH:" + xid); } + checkResponseCode(hdr); // remove the response for the xid if received by some other thread. synchronized (queuesLock) { resps.remove(xid); reqs.remove(xid); } - checkResponseCode(hdr); return true; } -- GitLab