|
Home > Archive > Apache Directory Project > June 2005 > [mina] Possible issue/fix with DemuxingProtocolCodecFactory
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
[mina] Possible issue/fix with DemuxingProtocolCodecFactory
|
|
| Adam Hathcock 2005-06-06, 7:48 am |
| I kept getting the IllegalStateException: "doDecode can't return true
when buffer is not consumed" from the CumulativeProtocolDecoder which
is used by the DemuxingProtocolCodec Factory (which I'm using in my
current project . I think I narrowed down the problem to these
lines starting at about line 229 in DemuxingProtocolCodec.java:
int limit = in.limit();
in.position( 0 );
MessageDecoderResult result = decoder.decodable( session, in );
in.position( 0 );
in.limit( limit );
I changed the 2nd and 4th lines so that the code is now:
int limit = in.limit();
int pos = in.position();
MessageDecoderResult result = decoder.decodable( session, in );
in.position( pos );
in.limit( limit );
Admittingly, I do not know what all this affects but it seems like
that the in buffer shouldn't have its position set to zero everytime
you check to see if the decoder can decode the message. It seems
like the buffer will have more than just a single message starting at
zero. I changed my local copy and I do not get the exception
anymore. If this breaks design and my code has the fault, let me know.
Thanks,
Adam
| |
| Trustin Lee 2005-06-06, 7:48 am |
| Hi Adam,
2005/5/30, Adam Hathcock <hathcah-7KF8pGZKO2M3uPMLIKxrzw@public.gmane.org>:
>
> I kept getting the IllegalStateException: "doDecode can't return true when
> buffer is not consumed" from the CumulativeProtocolDecoder which is used by
> the DemuxingProtocolCodec Factory (which I'm using in my current project .
> I think I narrowed down the problem to these lines starting at about line
> 229 in DemuxingProtocolCodec.java:
>
Thank you so much for your help! That was I was tracking all day. I
checked in the fix. Could you try the latest jar?
Thanks,
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
|
|
|
|
|