Skip to content

Commit 2a8e147

Browse files
committed
Use default ByteBufAllocator instead of context's one, see AsyncHttpClient#1029
1 parent a70031f commit 2a8e147

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

client/src/main/java/org/asynchttpclient/netty/request/body/BodyChunkedInput.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
import static org.asynchttpclient.util.Assertions.assertNotNull;
1717
import io.netty.buffer.ByteBuf;
18+
import io.netty.buffer.ByteBufAllocator;
1819
import io.netty.channel.ChannelHandlerContext;
1920
import io.netty.handler.stream.ChunkedInput;
2021

@@ -47,7 +48,7 @@ public ByteBuf readChunk(ChannelHandlerContext ctx) throws Exception {
4748
if (endOfInput)
4849
return null;
4950

50-
ByteBuf buffer = ctx.alloc().buffer(chunkSize);
51+
ByteBuf buffer = ByteBufAllocator.DEFAULT.buffer(chunkSize);
5152
Body.BodyState state = body.transferTo(buffer);
5253
switch (state) {
5354
case STOP:

0 commit comments

Comments
 (0)