release replaying decoder cumulation buffer after firing upstream
This commit is contained in:
parent
47a3783d6c
commit
1f3d35bd34
@ -504,6 +504,11 @@ public abstract class ReplayingDecoder<T extends Enum<T>>
|
||||
|
||||
// A successful decode
|
||||
unfoldAndFireMessageReceived(context, result, remoteAddress);
|
||||
|
||||
if (!cumulation.readable()) {
|
||||
this.cumulation.set(null);
|
||||
replayable = ReplayingDecoderBuffer.EMPTY_BUFFER;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -551,6 +556,7 @@ public abstract class ReplayingDecoder<T extends Enum<T>>
|
||||
} catch (ReplayError replay) {
|
||||
// Ignore
|
||||
} finally {
|
||||
replayable = ReplayingDecoderBuffer.EMPTY_BUFFER;
|
||||
ctx.sendUpstream(e);
|
||||
}
|
||||
}
|
||||
|
@ -27,6 +27,7 @@ import java.nio.charset.Charset;
|
||||
import org.jboss.netty.buffer.ChannelBuffer;
|
||||
import org.jboss.netty.buffer.ChannelBufferFactory;
|
||||
import org.jboss.netty.buffer.ChannelBufferIndexFinder;
|
||||
import org.jboss.netty.buffer.ChannelBuffers;
|
||||
|
||||
/**
|
||||
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
|
||||
@ -42,6 +43,12 @@ class ReplayingDecoderBuffer implements ChannelBuffer {
|
||||
private final ChannelBuffer buffer;
|
||||
private boolean terminated;
|
||||
|
||||
public static ReplayingDecoderBuffer EMPTY_BUFFER = new ReplayingDecoderBuffer(ChannelBuffers.EMPTY_BUFFER);
|
||||
|
||||
static {
|
||||
EMPTY_BUFFER.terminate();
|
||||
}
|
||||
|
||||
ReplayingDecoderBuffer(ChannelBuffer buffer) {
|
||||
this.buffer = buffer;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user