Better closes for SSL.

This commit is contained in:
Simone Bordet 2012-02-28 09:34:49 +01:00
parent ced68ab29b
commit 268e8bdbd7
1 changed files with 8 additions and 9 deletions

View File

@ -177,21 +177,20 @@ public class SPDYAsyncConnection extends AbstractConnection implements AsyncConn
try
{
AsyncEndPoint endPoint = getEndPoint();
if (onlyOutput)
try
{
try
{
logger.debug("Shutting down output {}", endPoint);
endPoint.shutdownOutput();
}
catch (IOException x)
// We need to gently close first, to allow
// SSL close alerts to be sent by Jetty
logger.debug("Shutting down output {}", endPoint);
endPoint.shutdownOutput();
if (!onlyOutput)
{
logger.debug("Closing {}", endPoint);
endPoint.close();
}
}
else
catch (IOException x)
{
logger.debug("Closing {}", endPoint);
endPoint.close();
}
}