Skip to content

Commit a13162c

Browse files
committed
NIO2 port
1 parent 4e8eead commit a13162c

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

java/org/apache/tomcat/util/net/SecureNio2Channel.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,15 @@ public void failed(Throwable exc, SocketWrapperBase<Nio2Channel> attachment) {
144144
public void reset(AsynchronousSocketChannel channel, SocketWrapperBase<Nio2Channel> socket) throws IOException {
145145
super.reset(channel, socket);
146146
sslEngine = null;
147-
sniComplete = false;
148-
handshakeComplete = false;
149-
handshakeWrapQueueLength.set(0);
150-
unwrapBeforeRead = true;
151-
closed = false;
152-
closing = false;
153-
netInBuffer.clear();
147+
if (channel != null) {
148+
sniComplete = false;
149+
handshakeComplete = false;
150+
handshakeWrapQueueLength.set(0);
151+
unwrapBeforeRead = true;
152+
closed = false;
153+
closing = false;
154+
netInBuffer.clear();
155+
}
154156
}
155157

156158
@Override

0 commit comments

Comments
 (0)