mirror of
https://github.com/bjdgyc/anylink.git
synced 2025-08-08 09:04:52 +08:00
修复DelSessByStoken的panic问题
This commit is contained in:
@@ -417,8 +417,11 @@ func CloseSess(token string) {
|
|||||||
|
|
||||||
delete(sessions, token)
|
delete(sessions, token)
|
||||||
delete(dtlsIds, sess.DtlsSid)
|
delete(dtlsIds, sess.DtlsSid)
|
||||||
|
|
||||||
|
if sess.CSess != nil {
|
||||||
sess.CSess.Close()
|
sess.CSess.Close()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func CloseCSess(token string) {
|
func CloseCSess(token string) {
|
||||||
sessMux.RLock()
|
sessMux.RLock()
|
||||||
@@ -428,8 +431,10 @@ func CloseCSess(token string) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if sess.CSess != nil {
|
||||||
sess.CSess.Close()
|
sess.CSess.Close()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func DelSessByStoken(stoken string) {
|
func DelSessByStoken(stoken string) {
|
||||||
stoken = strings.TrimSpace(stoken)
|
stoken = strings.TrimSpace(stoken)
|
||||||
|
Reference in New Issue
Block a user