Skip to content

Commit 861b08f

Browse files
committed
more logs
1 parent b8f0966 commit 861b08f

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

client/src/main/java/org/asynchttpclient/netty/handler/AsyncHttpClientHandler.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ public AsyncHttpClientHandler(AsyncHttpClientConfig config,//
6363
@Override
6464
public void channelRead(final ChannelHandlerContext ctx, Object msg) throws Exception {
6565

66+
LOGGER.debug("Channel {} read", ctx.channel());
67+
6668
Channel channel = ctx.channel();
6769
Object attribute = Channels.getAttribute(channel);
6870

@@ -85,7 +87,7 @@ public void channelRead(final ChannelHandlerContext ctx, Object msg) throws Exce
8587

8688
StreamedResponsePublisher publisher = (StreamedResponsePublisher) attribute;
8789

88-
if(msg instanceof HttpContent) {
90+
if (msg instanceof HttpContent) {
8991
ByteBuf content = ((HttpContent) msg).content();
9092
// Republish as a HttpResponseBodyPart
9193
if (content.readableBytes() > 0) {
@@ -120,6 +122,8 @@ public void channelRead(final ChannelHandlerContext ctx, Object msg) throws Exce
120122

121123
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
122124

125+
LOGGER.debug("Channel {} inactive", ctx.channel());
126+
123127
if (requestSender.isClosed())
124128
return;
125129

@@ -158,6 +162,9 @@ public void channelInactive(ChannelHandlerContext ctx) throws Exception {
158162

159163
@Override
160164
public void exceptionCaught(ChannelHandlerContext ctx, Throwable e) throws Exception {
165+
166+
LOGGER.debug("Channel {} exceptionCaught", ctx.channel());
167+
161168
Throwable cause = getCause(e.getCause());
162169

163170
if (cause instanceof PrematureChannelClosureException || cause instanceof ClosedChannelException)
@@ -221,11 +228,17 @@ public void exceptionCaught(ChannelHandlerContext ctx, Throwable e) throws Excep
221228

222229
@Override
223230
public void channelActive(ChannelHandlerContext ctx) throws Exception {
231+
232+
LOGGER.debug("Channel {} channelActive", ctx.channel());
233+
224234
ctx.read();
225235
}
226236

227237
@Override
228238
public void channelReadComplete(ChannelHandlerContext ctx) throws Exception {
239+
240+
LOGGER.debug("Channel {} channelReadComplete", ctx.channel());
241+
229242
if (!isHandledByReactiveStreams(ctx)) {
230243
ctx.read();
231244
} else {

0 commit comments

Comments
 (0)