fix null pointer in https
@@ -133,8 +133,10 @@ public final class AsyncSslSocket implements AsyncTcpSocket, AsyncTcpSocket.Even
@Override
public void onClosedWithError(Exception e) {
recycleByteBufs();
+ if (!closed) {
downstreamEventHandler.onClosedWithError(e);
}
+ }
@Override
public void setEventHandler(EventHandler eventHandler) {
@@ -189,6 +191,7 @@ public final class AsyncSslSocket implements AsyncTcpSocket, AsyncTcpSocket.Even
private void handleSSLException(final SSLException e, boolean post) {
upstream.close();
recycleByteBufs();
+ if (!closed) {
if (post) {
eventloop.post(new Runnable() {
@Override
@@ -200,6 +203,7 @@ public final class AsyncSslSocket implements AsyncTcpSocket, AsyncTcpSocket.Even
downstreamEventHandler.onClosedWithError(e);
}
}
+ }
private SSLEngineResult tryToUnwrap() throws SSLException {
ByteBuf dstBuf = ByteBufPool.allocate(engine.getSession().getPacketBufferSize());
