[#539] Potential direct memory leak in HttpContentEn/Decoder
This commit is contained in:
parent
88c3fd306b
commit
bf74b16774
@ -18,6 +18,7 @@ package org.jboss.netty.handler.codec.http;
|
||||
import org.jboss.netty.buffer.ChannelBuffer;
|
||||
import org.jboss.netty.buffer.ChannelBuffers;
|
||||
import org.jboss.netty.channel.ChannelHandlerContext;
|
||||
import org.jboss.netty.channel.ChannelStateEvent;
|
||||
import org.jboss.netty.channel.Channels;
|
||||
import org.jboss.netty.channel.MessageEvent;
|
||||
import org.jboss.netty.channel.SimpleChannelUpstreamHandler;
|
||||
@ -132,6 +133,14 @@ public abstract class HttpContentDecoder extends SimpleChannelUpstreamHandler {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception {
|
||||
// Clean-up the previous decoder if not cleaned up correctly.
|
||||
finishDecode();
|
||||
|
||||
super.channelClosed(ctx, e);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new {@link DecoderEmbedder} that decodes the HTTP message
|
||||
* content encoded in the specified <tt>contentEncoding</tt>.
|
||||
|
@ -21,6 +21,7 @@ import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
import org.jboss.netty.buffer.ChannelBuffer;
|
||||
import org.jboss.netty.buffer.ChannelBuffers;
|
||||
import org.jboss.netty.channel.ChannelHandlerContext;
|
||||
import org.jboss.netty.channel.ChannelStateEvent;
|
||||
import org.jboss.netty.channel.Channels;
|
||||
import org.jboss.netty.channel.MessageEvent;
|
||||
import org.jboss.netty.channel.SimpleChannelHandler;
|
||||
@ -166,6 +167,14 @@ public abstract class HttpContentEncoder extends SimpleChannelHandler {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception {
|
||||
// Clean-up the previous encoder if not cleaned up correctly.
|
||||
finishEncode();
|
||||
|
||||
super.channelClosed(ctx, e);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new {@link EncoderEmbedder} that encodes the HTTP message
|
||||
* content.
|
||||
|
Loading…
Reference in New Issue
Block a user