8223727: com/sun/jndi/ldap/privconn/RunTest.java failed due to hang in LdapRequest.getReplyBer

Reviewed-by: prappo
This commit is contained in:
Rob McKenna 2019-06-20 20:20:01 +00:00
parent b1c6ff7193
commit 9d9f9abe81

@ -411,6 +411,14 @@ public final class Connection implements Runnable {
BerDecoder readReply(LdapRequest ldr) throws IOException, NamingException {
BerDecoder rber;
// If socket closed, don't even try
synchronized (this) {
if (sock == null) {
throw new ServiceUnavailableException(host + ":" + port +
"; socket closed");
}
}
try {
// if no timeout is set so we wait infinitely until
// a response is received