mirror of
https://github.com/zr-hebo/sniffer-agent.git
synced 2025-09-18 17:56:52 +08:00
fix bug when deal invalid package
This commit is contained in:
@@ -119,7 +119,7 @@ func (nc *networkCard) listenNormal() {
|
|||||||
time.Sleep(time.Second*3)
|
time.Sleep(time.Second*3)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
// capture packets according to a certain probability
|
// capture packets according to a certain probability
|
||||||
tcpCapturePacketRate := communicator.GetTCPCapturePacketRate()
|
tcpCapturePacketRate := communicator.GetTCPCapturePacketRate()
|
||||||
if tcpCapturePacketRate <= 0 {
|
if tcpCapturePacketRate <= 0 {
|
||||||
|
@@ -149,6 +149,11 @@ func (ms *MysqlSession) readFromClient(seqID int64, bytes []byte) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ignore invalid head package
|
||||||
|
if len(bytes) <= 4{
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
contents := bytes[4:]
|
contents := bytes[4:]
|
||||||
// add prepare info
|
// add prepare info
|
||||||
if contents[0] == ComStmtPrepare {
|
if contents[0] == ComStmtPrepare {
|
||||||
|
Reference in New Issue
Block a user