directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julien Vermillard <jvermill...@archean.fr>
Subject Re: [mina] SSLFilter race condition: Take #2
Date Thu, 13 Oct 2005 13:02:39 GMT
Why not : 

public void messageReceived(IoSession session, Object message) {
    if (message instanceof MyStartTLSRequest) {
        // insert SSLFilter to start handshaking 
        session.getFilterChain().addFirst(sslFilter);

        // Disable encryption 
        sslFilter.setEnabled(false); // SSLfilter is bypassing

        // write StartTLSResponse 
        session.write(new MyStartTLSResponse(OK));

        // Enable encryption 
        sslFilter.setEnabled(true); // SSLfilter is crypting
    }
}


Le jeudi 13 octobre 2005 à 21:20 +0900, Trustin Lee a écrit :
> 2005/10/12, Trustin Lee <trustin@gmail.com>:
>         Which way do you prefer to the other?
> 
> Here's another option:
> 
> public void messageReceived(IoSession session, Object message) {
>     ...
>     if (message instanceof MyStartTLSRequest) {
>         // insert SSLFilter to start handshaking 
>         session.getFilterChain().addFirst(sslFilter);
> 
>         // Disable encryption for the specified message type.
>         sslFilter.excludeMessageType(MyStartTLSResponse.class);
> 
>         // write StartTLSResponse 
>         sessios.write(new MyStartTLSResponse(OK));
>     }
> }
> 
> WDYT?  Of course we have to provide includeMessageType(Class), too.
> 
> Please this discussion is very important for MINA API design, so it
> would be great if someone respond to this thread soon. 
> 
> Thanks in advance,
> Trustin
> 
> -- 
> what we call human nature is actually human habit
> --
> http://gleamynode.net/


Mime
View raw message