Skip to content

Commit

Permalink
Merge pull request #51 from gezhiwei8899/master
Browse files Browse the repository at this point in the history
[#50] XXL RST ERROR #50
  • Loading branch information
xuxueli authored Nov 23, 2024
2 parents 755360c + 74b2588 commit 87b47dc
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import io.netty.handler.codec.http.FullHttpResponse;
import io.netty.handler.codec.http.HttpHeaders;
import io.netty.handler.codec.http.HttpResponseStatus;
import io.netty.handler.timeout.IdleStateEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Objects;

/**
* netty_http
*
Expand All @@ -40,6 +43,14 @@ protected void channelRead0(ChannelHandlerContext ctx, FullHttpResponse msg) thr
throw new XxlRpcException("xxl-rpc response status invalid.");
}

HttpHeaders headers = msg.headers();
String connection = headers.get("connection");
if (Objects.equals("close", connection)) {
logger.warn(">>>>>>>>>>> xxl-rpc netty_http client received close");
ctx.close();
return;
}

// response parse
byte[] responseBytes = ByteBufUtil.getBytes(msg.content());

Expand Down

0 comments on commit 87b47dc

Please # to comment.