changeset 2415:d5939d20b762

6955783: ServiceUnavailableException caught even the secondary DNS is available Reviewed-by: vinnie
author weijun
date Thu, 27 May 2010 17:24:40 +0800
parents dfa98add4ad0
children 0f58be815a2e
files src/share/classes/com/sun/jndi/dns/DnsClient.java
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/jndi/dns/DnsClient.java	Tue May 25 15:39:38 2010 -0700
+++ b/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;
         }