On 9/26/06, Trustin Lee <[EMAIL PROTECTED]> wrote:
Hello Frédéric,

On 9/26/06, Frédéric Brégier <[EMAIL PROTECTED]> wrote:
>
> I would like to propose two patches.
>

<snip/>

For CompressionFilter, again except if I badly understood the code,
> I saw that perhaps the in buffer is not released.
>
> In messagedReceived :
> Change :
>
>         ByteBuffer inBuffer = ( ByteBuffer ) message;
>         ByteBuffer outBuffer = inflater.inflate( inBuffer );
>
>         nextFilter.messageReceived( session, outBuffer );
> into
>         ByteBuffer inBuffer = ( ByteBuffer ) message;
>         ByteBuffer outBuffer = inflater.inflate( inBuffer );
>         inBuffer.release();
>         nextFilter.messageReceived( session, outBuffer );
>
> In filterWrite :
> Change :
>         ByteBuffer inBuffer = ( ByteBuffer ) writeRequest.getMessage();
>
>         ByteBuffer outBuf = deflater.deflate( inBuffer );
>
>         nextFilter.filterWrite( session, new WriteRequest( outBuf,
> writeRequest
>                 .getFuture() ) );
> into
>         ByteBuffer inBuffer = ( ByteBuffer ) writeRequest.getMessage();
>
>         ByteBuffer outBuf = deflater.deflate( inBuffer );
>         inBuffer.release();
>         nextFilter.filterWrite( session, new WriteRequest( outBuf,
> writeRequest
>                 .getFuture() ) );
>
> I used both patch for a while without any problem until now.


Looks very fine to me.  Vinod is the main contributor of the compression
filter, so he might have something to say though.  If there's no comment, I
will apply this patch to 1.0.

I had purposely not released the inBuffer since I assumed MINA would
take care of it automatically.  If that's not so, we can apply that
patch.

Regards,
Vinod.

Reply via email to