增加对未建立成功会话的处理
This commit is contained in:
parent
5f9f324d78
commit
a80c1a5aaa
@ -102,6 +102,7 @@ func CloseSessionById(sessionId string, code int, reason string) {
|
|||||||
_ = tun.Tun.Close()
|
_ = tun.Tun.Close()
|
||||||
CloseSessionByWebSocket(tun.WebSocket, code, reason)
|
CloseSessionByWebSocket(tun.WebSocket, code, reason)
|
||||||
}
|
}
|
||||||
|
global.Store.Del(sessionId)
|
||||||
|
|
||||||
s, err := model.FindSessionById(sessionId)
|
s, err := model.FindSessionById(sessionId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -112,7 +113,12 @@ func CloseSessionById(sessionId string, code int, reason string) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
global.Store.Del(sessionId)
|
if s.Status == model.Connecting {
|
||||||
|
// 会话还未建立成功,无需保留数据
|
||||||
|
model.DeleteSessionById(sessionId)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
session := model.Session{}
|
session := model.Session{}
|
||||||
session.ID = sessionId
|
session.ID = sessionId
|
||||||
session.Status = model.Disconnected
|
session.Status = model.Disconnected
|
||||||
|
Loading…
Reference in New Issue
Block a user