1
0
mirror of https://github.com/fumiama/WireGold.git synced 2026-06-30 07:40:25 +08:00

add more logs

This commit is contained in:
源文雨
2023-08-04 13:48:46 +08:00
parent f474381db8
commit c90cee8c1b
5 changed files with 54 additions and 7 deletions

View File

@@ -18,7 +18,15 @@ func (m *Me) wait(data []byte) *head.Packet {
if len(data) < 60 { // not a valid packet
return nil
}
bound := 256
endl := "..."
if len(data) < bound {
bound = len(data)
endl = "."
}
logrus.Debugln("[recv] data bytes", hex.EncodeToString(data[:bound]), endl)
data = m.xor(data)
logrus.Debugln("[recv] data xored", hex.EncodeToString(data[:bound]), endl)
flags := binary.LittleEndian.Uint16(data[10:12])
if flags&0x8000 == 0x8000 { // not a valid packet
return nil