You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Sangjin Lee (JIRA)" <ji...@apache.org> on 2008/03/11 18:00:46 UTC

[jira] Created: (DIRMINA-548) subclass of CumulativeDecoder throws an UnsupportedOperationException if IoBuffer.slice() is used

subclass of CumulativeDecoder throws an UnsupportedOperationException if IoBuffer.slice() is used
-------------------------------------------------------------------------------------------------

                 Key: DIRMINA-548
                 URL: https://issues.apache.org/jira/browse/DIRMINA-548
             Project: MINA
          Issue Type: Bug
          Components: Core
    Affects Versions: 2.0.0-M1
            Reporter: Sangjin Lee


If one extends the CumulativeDecoder and finds that there is not enough data in the buffer, one returns false on doDecode() so mina can collect more data.  However, it seems that CumulativeDecoder puts the last remaining bytes from the decode into an UnderivableBuffer and stores it in the session.  When it gets more data later, the data is added to this session buffer, and the CumulativeDecoder subclass gets to it.

Calling methods like slice() and duplicate() on an UnderivableBuffer throw an exception.  Therefore, your cumulative decoder that does slice() will result in an exception.

See http://www.nabble.com/CumulativeDecoder-using-UnderivableBuffer-to15969933.html for more discussion.

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


[jira] Closed: (DIRMINA-548) subclass of CumulativeDecoder throws an UnsupportedOperationException if IoBuffer.slice() is used

Posted by "Sangjin Lee (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRMINA-548?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sangjin Lee closed DIRMINA-548.
-------------------------------


Thanks!  It works.

> subclass of CumulativeDecoder throws an UnsupportedOperationException if IoBuffer.slice() is used
> -------------------------------------------------------------------------------------------------
>
>                 Key: DIRMINA-548
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-548
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.0-M1
>            Reporter: Sangjin Lee
>            Assignee: Trustin Lee
>             Fix For: 2.0.0-M2
>
>
> If one extends the CumulativeDecoder and finds that there is not enough data in the buffer, one returns false on doDecode() so mina can collect more data.  However, it seems that CumulativeDecoder puts the last remaining bytes from the decode into an UnderivableBuffer and stores it in the session.  When it gets more data later, the data is added to this session buffer, and the CumulativeDecoder subclass gets to it.
> Calling methods like slice() and duplicate() on an UnderivableBuffer throw an exception.  Therefore, your cumulative decoder that does slice() will result in an exception.
> See http://www.nabble.com/CumulativeDecoder-using-UnderivableBuffer-to15969933.html for more discussion.

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


[jira] Resolved: (DIRMINA-548) subclass of CumulativeDecoder throws an UnsupportedOperationException if IoBuffer.slice() is used

Posted by "Trustin Lee (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRMINA-548?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Trustin Lee resolved DIRMINA-548.
---------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0.0-M2
         Assignee: Trustin Lee

I've just fixed this issue by modifying CumulativeProtocolDecoder to reallocate its internal buffer when buffer derivation is detected.  Please confirm the fix and close this issue.

> subclass of CumulativeDecoder throws an UnsupportedOperationException if IoBuffer.slice() is used
> -------------------------------------------------------------------------------------------------
>
>                 Key: DIRMINA-548
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-548
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.0-M1
>            Reporter: Sangjin Lee
>            Assignee: Trustin Lee
>             Fix For: 2.0.0-M2
>
>
> If one extends the CumulativeDecoder and finds that there is not enough data in the buffer, one returns false on doDecode() so mina can collect more data.  However, it seems that CumulativeDecoder puts the last remaining bytes from the decode into an UnderivableBuffer and stores it in the session.  When it gets more data later, the data is added to this session buffer, and the CumulativeDecoder subclass gets to it.
> Calling methods like slice() and duplicate() on an UnderivableBuffer throw an exception.  Therefore, your cumulative decoder that does slice() will result in an exception.
> See http://www.nabble.com/CumulativeDecoder-using-UnderivableBuffer-to15969933.html for more discussion.

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