Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
TangSiyang2001 committed Aug 14, 2024
1 parent 35f5e90 commit dccc95a
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ public void initSslBuffer() {

public void setSequenceId(int sequenceId) {
this.sequenceId = sequenceId;
LOG.info("set seq id to 0");
}

public String getRemoteIp() {
Expand Down Expand Up @@ -172,7 +173,9 @@ private int packetLen(boolean isSslHeader) {

private void accSequenceId() {
sequenceId++;
LOG.info("add seq id to {}", sequenceId);
if (sequenceId > 255) {
LOG.info("reset sequence id");
sequenceId = 0;
}
}
Expand Down Expand Up @@ -318,7 +321,7 @@ public ByteBuffer fetchOnePacket() throws IOException {
byte[] header = result.array();
int packetId = header[3] & 0xFF;
if (packetId != sequenceId) {
LOG.warn("receive packet sequence id[" + packetId() + "] want to get[" + sequenceId + "]");
LOG.warn("receive packet sequence id[" + packetId + "] want to get[" + sequenceId + "]");
throw new IOException("Bad packet sequence.");
}
int mysqlPacketLength = (header[0] & 0xFF) | ((header[1] & 0XFF) << 8) | ((header[2] & 0XFF) << 16);
Expand Down

0 comments on commit dccc95a

Please sign in to comment.