Close ssl on engine CLOSED status
@@ -301,11 +301,20 @@ public final class AsyncSslSocket implements AsyncTcpSocket, AsyncTcpSocket.Even
}
}
+ private void doClose() {
+ upstream.close();
+ recycleByteBufs();
+ }
+
@SuppressWarnings("UnusedAssignment")
private void doSync() throws SSLException {
HandshakeStatus handshakeStatus;
SSLEngineResult result = null;
while (true) {
+ if (result != null && result.getStatus() == CLOSED) {
+ doClose();
+ break;
+ }
handshakeStatus = engine.getHandshakeStatus();
if (handshakeStatus == NEED_WRAP) {
result = tryToWrap();
