mirror of
https://github.com/zr-hebo/sniffer-agent.git
synced 2025-08-07 14:39:02 +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))
|
||||
|
||||
if ms.expectReceiveSize == -1 {
|
||||
ms.expectReceiveSize = extractMysqlPayloadSize(bytes[:4])
|
||||
// ignore too big mysql packet
|
||||
if ms.expectReceiveSize >= MaxMysqlPacketLen {
|
||||
// ignore invalid head package
|
||||
if len(bytes) <= 4{
|
||||
return
|
||||
}
|
||||
|
||||
// ignore invalid head package
|
||||
if len(bytes) <= 4{
|
||||
ms.expectReceiveSize = extractMysqlPayloadSize(bytes[:4])
|
||||
// ignore too big mysql packet
|
||||
if ms.expectReceiveSize >= MaxMysqlPacketLen {
|
||||
return
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user