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:
|
global:
|
||||||
loglevel: info
|
|
||||||
http:
|
http:
|
||||||
listenaddr: :8801 # 网关地址,用于访问API
|
listenaddr: :8801 # 网关地址,用于访问API
|
||||||
listenaddrtls: :8443 # 用于HTTPS方式访问API的端口配置
|
listenaddrtls: :8443 # 用于HTTPS方式访问API的端口配置
|
||||||
|
|||||||
@@ -41,9 +41,11 @@ func InitHttpHook(addr string, hs *hook_message_work.HookService) {
|
|||||||
switch state {
|
switch state {
|
||||||
case http.StateHijacked, http.StateClosed:
|
case http.StateHijacked, http.StateClosed:
|
||||||
etoken, _ := activeConnections.Load(conn.RemoteAddr().String())
|
etoken, _ := activeConnections.Load(conn.RemoteAddr().String())
|
||||||
data := netbase.CreateConnectionInfo(message.DisConnectMes, "http", conn.RemoteAddr().String(), conn.RemoteAddr().String(), etoken.(*tool.DeviceAuth))
|
if etoken != nil {
|
||||||
activeConnections.Delete(conn.RemoteAddr().String())
|
data := netbase.CreateConnectionInfo(message.DisConnectMes, "http", conn.RemoteAddr().String(), conn.RemoteAddr().String(), etoken.(*tool.DeviceAuth))
|
||||||
service.HookService.MessageCh <- data
|
activeConnections.Delete(conn.RemoteAddr().String())
|
||||||
|
service.HookService.MessageCh <- data
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
err := server.Start(context.TODO())
|
err := server.Start(context.TODO())
|
||||||
|
|||||||
Reference in New Issue
Block a user