1
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
xinian
2026-02-23 21:42:36 +08:00
committed by cnb
parent 215ce98c22
commit 50a19b2ff9
3 changed files with 6 additions and 8 deletions

View File

@@ -192,10 +192,7 @@ func (s *Server) handleTCP(conn gnet.Conn) (action gnet.Action) {
conn.Context().(*player.ClientData).IsCrossDomain.Do(func() { //跨域检测
handle(conn)
})
// 1. 检查最小可读长度(避免无效 Peek
if conn.InboundBuffered() < 17 {
return gnet.None
}
// handle(c)
// 先读取4字节的包长度
lenBuf, err := conn.Peek(4)