From 347131e0fa4cdf9340a27d1e5500d985e30657a7 Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Thu, 27 Aug 2009 05:56:40 +0000 Subject: [PATCH] Fixed issue: NETTY-215 ChunkedWriteHandler stops handling write queue when ChunkedInput.nextChunk() fails. * Fixed a bad file descriptor error --- .../org/jboss/netty/handler/stream/ChunkedWriteHandler.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/jboss/netty/handler/stream/ChunkedWriteHandler.java b/src/main/java/org/jboss/netty/handler/stream/ChunkedWriteHandler.java index 8a3d3bb4db..e0a86aa85d 100644 --- a/src/main/java/org/jboss/netty/handler/stream/ChunkedWriteHandler.java +++ b/src/main/java/org/jboss/netty/handler/stream/ChunkedWriteHandler.java @@ -221,7 +221,6 @@ public class ChunkedWriteHandler implements ChannelUpstreamHandler, ChannelDowns throws Exception { if (!future.isSuccess()) { currentEvent.getFuture().setFailure(future.getCause()); - ((ChunkedInput) currentEvent.getMessage()).close(); } } }); @@ -234,6 +233,11 @@ public class ChunkedWriteHandler implements ChannelUpstreamHandler, ChannelDowns ctx.sendDownstream(currentEvent); currentEvent = null; } + + if (!channel.isConnected()) { + discard(ctx); + break; + } } } }