Hi, I'm afraid it's not enough to block sessionCreated() and messageReceived(). I think all IoFilter methods except init() and destroy(), filterWrite(), filterClose() and maybe exceptionCaught() will have to be intercepted by BlacklistFilter and checked against the blacklist.
It would be nice if there are always consistency in what order the IoHandler callbacks are called. E.g. sessionCreated is always called first, then sessionOpened, then 0 or more messageReceived/messageSent followed by sessionClosed. If only sessionCreated is blocked, sessionOpened could be called first which could lead to strange bugs if the Mina user uses sessionCreated to allocate resources etc. /Niklas Trustin Lee wrote: > Ah I see. I'll fix that now. > > 2005/11/3, Niklas Therning <[EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]>>: > > I think the BlacklistFilter should implement all of the upstream > IoFilter callbacks, not just sessionCreated(), to prevent those events > to be propagated to the IoHandler. I have a situation where > messageReceived() is called in my IoHandler even if > BlacklistFilter has > blocked the client. I guess it's because it takes some time for the > CloseRequest to be picked up by SocketIoProcessor. > > If we don't want to call BlacklistFilter.isBlocked(IoSession) for > every > upstream event we could instead add an attribute to the session in > BlacklistFilter.sessionCreated() which tells whether the connection is > blocked or not and use that attribute in all the other events. > > WDYT? > > /Niklas > > > > > -- > what we call human nature is actually human habit > -- > http://gleamynode.net/ -- Med vänlig hälsning Niklas Therning Software Architect [EMAIL PROTECTED] Mobil: +46 739 75 05 73 Trillian - Software Design at its best www.trillian.se
