@Override
public void channelRead0(ChannelHandlerContext ctx, HttpObject msg) {
if (LOGGER.isDebugEnabled()) {
if (msg instanceof HttpResponse) {
HttpResponse response = (HttpResponse) msg;
LOGGER.debug("STATUS: " + response.getStatus());
LOGGER.debug("VERSION: " + response.getProtocolVersion());
if (!response.headers().isEmpty()) {
for (String name : response.headers().names()) {
for (String value : response.headers().getAll(name)) {
LOGGER.debug("HEADER: " + name + " = " + value);
}
}
}
if (HttpHeaders.isTransferEncodingChunked(response)) {
LOGGER.debug("CHUNKED CONTENT {");
} else {
LOGGER.debug("CONTENT {");
}
}
if (msg instanceof HttpContent) {
HttpContent content = (HttpContent) msg;
LOGGER.debug(content.content().toString(CharsetUtil.UTF_8));
if (content instanceof LastHttpContent) {
LOGGER.debug("} END OF CONTENT");
}
}
}
}
DebugClientHandler.java 文件源码
java
阅读 28
收藏 0
点赞 0
评论 0
项目:ServiceCOLDCache
作者:
评论列表
文章目录