directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Trustin Lee <trus...@gmail.com>
Subject Re: [mina] SSLFilter race condition: Take #2
Date Thu, 13 Oct 2005 12:20:50 GMT
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