修改底层连接,防止无限升级协议
This commit is contained in:
@@ -100,7 +100,10 @@ func (s *Server) OnTraffic(c gnet.Conn) (action gnet.Action) {
|
||||
return action
|
||||
}
|
||||
if !ok { //升级失败,说明是tcp连接
|
||||
|
||||
if c.Context().(*player.ClientData).ERROR_CONNUT > 5 {
|
||||
return gnet.Close
|
||||
}
|
||||
c.Context().(*player.ClientData).ERROR_CONNUT += 1
|
||||
return s.handleTcp(c)
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user