mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-04-23 02:48:34 +08:00
【fix】应用异常掉线
This commit is contained in:
@@ -75,7 +75,6 @@ gen:
|
||||
|
||||
# 视频服务器使用的全局配置
|
||||
global:
|
||||
loglevel: info
|
||||
http:
|
||||
listenaddr: :8801 # 网关地址,用于访问API
|
||||
listenaddrtls: :8443 # 用于HTTPS方式访问API的端口配置
|
||||
|
||||
@@ -41,9 +41,11 @@ func InitHttpHook(addr string, hs *hook_message_work.HookService) {
|
||||
switch state {
|
||||
case http.StateHijacked, http.StateClosed:
|
||||
etoken, _ := activeConnections.Load(conn.RemoteAddr().String())
|
||||
data := netbase.CreateConnectionInfo(message.DisConnectMes, "http", conn.RemoteAddr().String(), conn.RemoteAddr().String(), etoken.(*tool.DeviceAuth))
|
||||
activeConnections.Delete(conn.RemoteAddr().String())
|
||||
service.HookService.MessageCh <- data
|
||||
if etoken != nil {
|
||||
data := netbase.CreateConnectionInfo(message.DisConnectMes, "http", conn.RemoteAddr().String(), conn.RemoteAddr().String(), etoken.(*tool.DeviceAuth))
|
||||
activeConnections.Delete(conn.RemoteAddr().String())
|
||||
service.HookService.MessageCh <- data
|
||||
}
|
||||
}
|
||||
}
|
||||
err := server.Start(context.TODO())
|
||||
|
||||
Reference in New Issue
Block a user