gentler SSL close

This commit is contained in:
Greg Wilkins 2011-10-11 16:05:17 +11:00
parent 4149ff4d21
commit 06f4ada935
1 changed files with 7 additions and 3 deletions

View File

@ -242,7 +242,10 @@ public class SslSelectChannelEndPoint extends SelectChannelEndPoint
if (_closing)
{
if (outBuf!=null && outBuf.hasContent())
throw new IOException("Write while closing");
{
LOG.debug("Write while closing");
outBuf.clear();
}
break;
}
@ -317,7 +320,7 @@ public class SslSelectChannelEndPoint extends SelectChannelEndPoint
// Need more data to be unwrapped so try another call to unwrap
progress|=unwrap(inBBuf);
if (_closing)
if (_closing && inBBuf.hasRemaining())
inBBuf.clear();
break;
}
@ -643,7 +646,8 @@ public class SslSelectChannelEndPoint extends SelectChannelEndPoint
catch(SSLException e)
{
LOG.warn(getRemoteAddr()+":"+getRemotePort()+" ",e);
super.close();
if (getChannel().isOpen())
getChannel().close();
throw e;
}
finally