The ProtocolDecoderOutput class initialization will fail if some filter is 
added after the codec
------------------------------------------------------------------------------------------------

                 Key: DIRMINA-636
                 URL: https://issues.apache.org/jira/browse/DIRMINA-636
             Project: MINA
          Issue Type: Bug
    Affects Versions: 2.0.0-M3
            Reporter: Emmanuel Lecharny


The way this class is initialized is wrong : it takes the nextFilter as a 
parameter, which means we can't add a filter after the codec without having a 
broken chain.

Here is the method which initialize this object :

    private ProtocolDecoderOutput getDecoderOut(IoSession session,
            NextFilter nextFilter) {
        ProtocolDecoderOutput out = (ProtocolDecoderOutput) 
session.getAttribute(DECODER_OUT);
        if (out == null) {
            out = new ProtocolDecoderOutputImpl(session, nextFilter);  <===== 
This is WRONG
            session.setAttribute(DECODER_OUT, out);
        }
        return out;
    }

It would be way better not to pass the <NextFilter, Session> to the 
constructor, but passing them to the flush() method, avoiding any potential 
problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to