fix bug of read short packet
This commit is contained in:
parent
6b87d5bf06
commit
a01de02f9a
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue