修复DelSessByStoken的panic问题

This commit is contained in:
bjdgyc 2022-11-07 17:16:32 +08:00
parent 87dcc63b6f
commit 50c30657ac
1 changed files with 7 additions and 2 deletions

View File

@ -417,8 +417,11 @@ func CloseSess(token string) {
delete(sessions, token)
delete(dtlsIds, sess.DtlsSid)
if sess.CSess != nil {
sess.CSess.Close()
}
}
func CloseCSess(token string) {
sessMux.RLock()
@ -428,8 +431,10 @@ func CloseCSess(token string) {
return
}
if sess.CSess != nil {
sess.CSess.Close()
}
}
func DelSessByStoken(stoken string) {
stoken = strings.TrimSpace(stoken)