# HG changeset patch # User weijun # Date 1274952280 -28800 # Node ID 302c8bd0d94276e16c94fd039188ac3688af82da # Parent 5c9695dc013a9f5b45e08ee7e9ff147e2945b223 6955783: ServiceUnavailableException caught even the secondary DNS is available Reviewed-by: vinnie diff -r 5c9695dc013a -r 302c8bd0d942 jdk/src/share/classes/com/sun/jndi/dns/DnsClient.java --- a/jdk/src/share/classes/com/sun/jndi/dns/DnsClient.java Tue May 25 15:39:38 2010 -0700 +++ b/jdk/src/share/classes/com/sun/jndi/dns/DnsClient.java Thu May 27 17:24:40 2010 +0800 @@ -525,11 +525,11 @@ } 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 @@ 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; }