Skip to content

Commit 1ebe97a

Browse files
author
Stephane Landelle
committed
Minor clean up
1 parent 005c0d4 commit 1ebe97a

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

providers/netty4/src/main/java/org/asynchttpclient/providers/netty4/NettyChannelHandler.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,11 @@ public void channelRead(final ChannelHandlerContext ctx, Object e) throws Except
8686

8787
Object attribute = Channels.getDefaultAttribute(ctx);
8888

89-
if (attribute instanceof Callback) {
89+
// FIXME is || !(e instanceof HttpContent) necessary?
90+
if (attribute instanceof Callback && (e instanceof LastHttpContent /*|| !(e instanceof HttpContent)*/)) {
9091
Callback ac = (Callback) attribute;
91-
if (e instanceof LastHttpContent || !(e instanceof HttpContent)) {
92-
ac.call();
93-
Channels.setDefaultAttribute(ctx, DiscardEvent.INSTANCE);
94-
}
92+
ac.call();
93+
Channels.setDefaultAttribute(ctx, DiscardEvent.INSTANCE);
9594

9695
} else if (attribute instanceof NettyResponseFuture) {
9796
Protocol p = (ctx.pipeline().get(HttpClientCodec.class) != null ? httpProtocol : webSocketProtocol);

0 commit comments

Comments
 (0)