修改包头len规则

This commit is contained in:
duanhf2012
2020-04-13 16:20:50 +08:00
parent 59a498db8d
commit 57708ec822

View File

@@ -97,8 +97,7 @@ func (p *MsgParser) Read(conn *TCPConn) ([]byte, error) {
} else if msgLen < p.minMsgLen {
return nil, errors.New("message too short")
}
msgLen -= 2
// data
msgData := make([]byte, msgLen)
if _, err := io.ReadFull(conn, msgData); err != nil {