b-wagner commented on code in PR #49: URL: https://github.com/apache/mina/pull/49#discussion_r2025490309
########## mina-core/src/main/java/org/apache/mina/filter/ssl/SslFilter.java: ########## @@ -520,62 +572,63 @@ public void messageReceived(NextFilter nextFilter, IoSession session, Object mes SslHandler sslHandler = getSslSessionHandler(session); AtomicBoolean canPushMessage = new AtomicBoolean( false ); - // The SslHandler instance is *guaranteed* to nit be null here + // The SslHandler instance is *guaranteed* to not be null here + synchronized (sslHandler.getCccLock()) { + synchronized (sslHandler) { + if ((sslHandler.isOutboundDone() && sslHandler.isInboundDone()) || sslHandler.isDisabled()) { + // We aren't handshaking here. Let's push the message to the next filter - synchronized (sslHandler) { - if (sslHandler.isOutboundDone() && sslHandler.isInboundDone()) { - // We aren't handshaking here. Let's push the message to the next filter - - // Note: we can push the message to the queue immediately, - // but don't do so in the synchronized block. We use a protected - // flag to do so. - canPushMessage.set( true ); - } else { - canPushMessage.set( false ); - IoBuffer buf = (IoBuffer) message; - - try { - if (sslHandler.isOutboundDone()) { - sslHandler.destroy(); - throw new SSLException("Outbound done"); - } - - // forward read encrypted data to SSL handler - sslHandler.messageReceived(nextFilter, buf.buf()); - - // Handle data to be forwarded to application or written to net - handleSslData(nextFilter, sslHandler); - - if (sslHandler.isInboundDone()) { - if (sslHandler.isOutboundDone()) { + // Note: we can push the message to the queue immediately, + // but don't do so in the synchronized block. We use a protected + // flag to do so. + canPushMessage.set( true ); + } else { + canPushMessage.set( false ); + IoBuffer buf = (IoBuffer) message; + + try { + if (sslHandler.isOutboundDone() && !sslHandler.isCCCEnabled()) { Review Comment: This entire 'if' block was originally commented out in our fork, citing issues with CCC and close notify. To not break backwards compatibility, I added the addition check for CCC enabled. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org For additional commands, e-mail: dev-h...@mina.apache.org