[#1159] Make sure we not produce an empty bytebuf on decodeLast(..)
This commit is contained in:
parent
835a40fa25
commit
d9c3f4bc05
@ -148,7 +148,13 @@ public final class HttpClientCodec
|
||||
protected Object decode(
|
||||
ChannelHandlerContext ctx, ByteBuf buffer) throws Exception {
|
||||
if (done) {
|
||||
return buffer.readBytes(actualReadableBytes());
|
||||
int readable = actualReadableBytes();
|
||||
if (readable == 0) {
|
||||
// if non is readable just return null
|
||||
// https://github.com/netty/netty/issues/1159
|
||||
return null;
|
||||
}
|
||||
return buffer.readBytes(readable);
|
||||
} else {
|
||||
Object msg = super.decode(ctx, buffer);
|
||||
if (failOnMissingResponse) {
|
||||
|
Loading…
Reference in New Issue
Block a user