Skip to content

Commit a70031f

Browse files
committed
Don't resolve ChunkedWriteHandler every time content is added
1 parent 864c00d commit a70031f

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/NettyBodyBody.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,11 @@ public void write(final Channel channel, NettyResponseFuture<?> future) throws I
6969

7070
BodyGenerator bg = future.getTargetRequest().getBodyGenerator();
7171
if (bg instanceof FeedableBodyGenerator && !(bg instanceof ReactiveStreamsBodyGenerator)) {
72+
final ChunkedWriteHandler chunkedWriteHandler = channel.pipeline().get(ChunkedWriteHandler.class);
7273
FeedableBodyGenerator.class.cast(bg).setListener(new FeedListener() {
7374
@Override
7475
public void onContentAdded() {
75-
channel.pipeline().get(ChunkedWriteHandler.class).resumeTransfer();
76+
chunkedWriteHandler.resumeTransfer();
7677
}
7778
@Override
7879
public void onError(Throwable t) {}

0 commit comments

Comments
 (0)