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 try
{ {
AsyncEndPoint endPoint = getEndPoint(); AsyncEndPoint endPoint = getEndPoint();
if (onlyOutput) try
{ {
try // We need to gently close first, to allow
{ // SSL close alerts to be sent by Jetty
logger.debug("Shutting down output {}", endPoint); logger.debug("Shutting down output {}", endPoint);
endPoint.shutdownOutput(); endPoint.shutdownOutput();
} if (!onlyOutput)
catch (IOException x)
{ {
logger.debug("Closing {}", endPoint);
endPoint.close(); endPoint.close();
} }
} }
else catch (IOException x)
{ {
logger.debug("Closing {}", endPoint);
endPoint.close(); endPoint.close();
} }
} }