[JBoss JIRA] Resolved: (NETTY-374) ChunkedWriteHandler and handling messages after channel close

Trustin Lee (JIRA) jira-events at lists.jboss.org
Wed Jan 12 04:28:50 EST 2011


     [ https://issues.jboss.org/browse/NETTY-374?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Trustin Lee resolved NETTY-374.
-------------------------------

    Fix Version/s: 3.2.4.Final
       Resolution: Done


Thanks for the patch.  Nice catch. :-)

> ChunkedWriteHandler and handling messages after channel close
> -------------------------------------------------------------
>
>                 Key: NETTY-374
>                 URL: https://issues.jboss.org/browse/NETTY-374
>             Project: Netty
>          Issue Type: Bug
>          Components: Handler
>    Affects Versions: 3.2.3.Final
>            Reporter: Piotr Bartosiewicz
>            Assignee: Trustin Lee
>             Fix For: 3.2.4.Final
>
>
> There is another bug in ChunkedWriteHandler. 
> OperationComplete is never fired on the operation future if a message was send after channel was closed.
> Below is my fix:
>     public void handleDownstream(ChannelHandlerContext ctx, ChannelEvent e)
>             throws Exception {
>         if (!(e instanceof MessageEvent)) {
>             ctx.sendDownstream(e);
>             return;
>         }
>         boolean offered = queue.offer((MessageEvent) e);
>         assert offered;
>         if (ctx.getChannel().isWritable()) {
>             this.ctx = ctx;
>             flush(ctx);
> +       } else if (!ctx.getChannel().isOpen()) {
> +       	this.ctx = ctx;
> +       	discard(ctx);
>         }
>     }

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the netty-dev mailing list