Skip to content
This repository was archived by the owner on May 6, 2023. It is now read-only.

Commit

Permalink
修复连接关闭时可能出现崩溃
Browse files Browse the repository at this point in the history
  • Loading branch information
perrornet committed Feb 27, 2022
1 parent 1d759ff commit b02e98f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.idea
*.log
*.txt
local
3 changes: 3 additions & 0 deletions proxy/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ func NewServer(address, secretKey, PoolAddress string) error {
}

func (ps *Server) OnClosed(c gnet.Conn, _ error) (action gnet.Action) {
if c == nil {
return gnet.None
}
clientId, ok := connId2Id.Load(c.RemoteAddr().String())
if !ok {
return gnet.None
Expand Down

0 comments on commit b02e98f

Please sign in to comment.