mirror of
https://github.com/zr-hebo/sniffer-agent.git
synced 2025-08-07 14:39:02 +08:00
修复设置抓包率引起的查询时间异常的问题
This commit is contained in:
@@ -87,7 +87,7 @@ func (ms *MysqlSession) ReceiveTCPPacket(newPkt *model.TCPPacket) {
|
||||
ms.readFromClient(newPkt.Seq, newPkt.Payload)
|
||||
|
||||
} else {
|
||||
ms.readFromServer(newPkt.Payload)
|
||||
ms.readFromServer(newPkt.Seq, newPkt.Payload)
|
||||
qp := ms.GenerateQueryPiece()
|
||||
if qp != nil {
|
||||
ms.queryPieceReceiver <- qp
|
||||
@@ -99,7 +99,7 @@ func (ms *MysqlSession) resetBeginTime() {
|
||||
ms.stmtBeginTime = time.Now().UnixNano() / millSecondUnit
|
||||
}
|
||||
|
||||
func (ms *MysqlSession) readFromServer(bytes []byte) {
|
||||
func (ms *MysqlSession) readFromServer(respSeq int64, bytes []byte) {
|
||||
if ms.expectSendSize < 1 && len(bytes) > 4 {
|
||||
ms.expectSendSize = extractMysqlPayloadSize(bytes[:4])
|
||||
contents := bytes[4:]
|
||||
@@ -107,6 +107,10 @@ func (ms *MysqlSession) readFromServer(bytes []byte) {
|
||||
ms.prepareInfo.prepareStmtID = bytesToInt(contents[1:5])
|
||||
}
|
||||
}
|
||||
|
||||
if ms.coverRanges.head.next == nil || ms.coverRanges.head.next.end != respSeq {
|
||||
ms.clear()
|
||||
}
|
||||
}
|
||||
|
||||
func (ms *MysqlSession) checkFinish() bool {
|
||||
|
Reference in New Issue
Block a user