mirror of
https://github.com/zr-hebo/sniffer-agent.git
synced 2025-08-10 09:23:27 +08:00
fix bug of read short packet
This commit is contained in:
@@ -143,14 +143,14 @@ func (ms *MysqlSession) readFromClient(seqID int64, bytes []byte) {
|
|||||||
contentSize := int64(len(bytes))
|
contentSize := int64(len(bytes))
|
||||||
|
|
||||||
if ms.expectReceiveSize == -1 {
|
if ms.expectReceiveSize == -1 {
|
||||||
ms.expectReceiveSize = extractMysqlPayloadSize(bytes[:4])
|
// ignore invalid head package
|
||||||
// ignore too big mysql packet
|
if len(bytes) <= 4{
|
||||||
if ms.expectReceiveSize >= MaxMysqlPacketLen {
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// ignore invalid head package
|
ms.expectReceiveSize = extractMysqlPayloadSize(bytes[:4])
|
||||||
if len(bytes) <= 4{
|
// ignore too big mysql packet
|
||||||
|
if ms.expectReceiveSize >= MaxMysqlPacketLen {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user