[ 
https://issues.apache.org/jira/browse/DIRMINA-1161?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17486466#comment-17486466
 ] 

Pavel Garin commented on DIRMINA-1161:
--------------------------------------

Decoders do not work in parallel with one session. They are added one after 
another in filterChain.

 
{code:java}
filterChain.addLast("first" , new ProtocolCodecFilter(firstCodecFactory)); 
//firstCodecFactory.getDecoder(IoSession session) return instance class A 
extends CumulativeProtocolDecoder
filterChain.addLast("second", new ProtocolCodecFilter(secondCodecFactory)); 
//secondCodecFactory.getDecoder(IoSession session) return instance class B 
extends CumulativeProtocolDecoder
{code}
 

> Accessing the session buffer of multiple decoders
> -------------------------------------------------
>
>                 Key: DIRMINA-1161
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-1161
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.22, 2.1.4
>         Environment: Ubuntu 16.04.7 LTS
> Open JDK 11.0.10
> Mina 2.0.22
>            Reporter: Pavel Garin
>            Priority: Major
>             Fix For: 2.0.23, 2.1.5
>
>
> As of Mina 2.0.17, the line of code in CumulativeProtocolDecoder 
>  
> {code:java}
> private final AttributeKey BUFFER = new AttributeKey(getClass(), "buffer"); 
> {code}
> has been replaced with line 
> {code:java}
> private static final AttributeKey BUFFER = new 
> AttributeKey(CumulativeProtocolDecoder.class, "buffer");{code}
> When using an architecture where multiple decoders inherited from 
> CumulativeProtocolDecoder are used, the decoders corrupt each other's data. 
> The key for the attribute in line 
> {code:java}
> IoBuffer buf = (IoBuffer) session.getAttribute(BUFFER);{code}
> has become the same for all decoders.
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org

Reply via email to