capture big mysql package

This commit is contained in:
hebo
2019-08-20 19:44:03 +08:00
parent 5c15db3353
commit a7bdc40976
7 changed files with 219 additions and 119 deletions

View File

@@ -3,7 +3,6 @@ package mysql
import (
"bytes"
"encoding/binary"
"fmt"
)
// parseHandshakeResponseHeader parses the common header of SSLRequest and HandshakeResponse41.
@@ -123,9 +122,6 @@ func parseLengthEncodedInt(b []byte) (num uint64, isNull bool, n int) {
}
func extractMysqlPayloadSize(header []byte) int {
fmt.Printf("==== package header: %v\n", header)
// return int(uint32(header[0]) | uint32(header[1])<<8 | uint32(header[2])<<16)
return int(uint32(header[0]) | uint32(header[1])<<8 | uint32(header[2])<<16)
}