mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
Temporary websocket disconnect handling (#6)
* fix websocket close log error. * logger session interface no pointer. * websocket delayet disconnect. * session host: save id not pointer to a session. * fix if hostId not stored.
This commit is contained in:
@ -42,7 +42,7 @@ func (h *MessageHandlerCtx) controlRequest(session types.Session) error {
|
||||
|
||||
if !h.sessions.Settings().ImplicitHosting {
|
||||
// tell session if there is a host
|
||||
if host := h.sessions.GetHost(); host != nil {
|
||||
if host, hasHost := h.sessions.GetHost(); hasHost {
|
||||
session.Send(
|
||||
event.CONTROL_HOST,
|
||||
message.ControlHost{
|
||||
|
@ -12,14 +12,16 @@ import (
|
||||
)
|
||||
|
||||
func (h *MessageHandlerCtx) systemInit(session types.Session) error {
|
||||
host := h.sessions.GetHost()
|
||||
host, hasHost := h.sessions.GetHost()
|
||||
|
||||
controlHost := message.ControlHost{
|
||||
HasHost: host != nil,
|
||||
var hostID string
|
||||
if hasHost {
|
||||
hostID = host.ID()
|
||||
}
|
||||
|
||||
if controlHost.HasHost {
|
||||
controlHost.HostID = host.ID()
|
||||
controlHost := message.ControlHost{
|
||||
HasHost: hasHost,
|
||||
HostID: hostID,
|
||||
}
|
||||
|
||||
size := h.desktop.GetScreenSize()
|
||||
|
Reference in New Issue
Block a user