1
0
forked from x/icebergs
This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-09-27 23:58:19 +08:00
parent 0bff96f485
commit c4b9641a5e

View File

@ -138,7 +138,7 @@ func _space_handle(m *ice.Message, safe bool, name string, c *websocket.Conn) {
kit.If(msg.Option(ice.MSG_USERROLE), func() { msg.Option(ice.MSG_USERROLE, aaa.VOID) })
}
source, target := kit.Simple(msg.Optionv(ice.MSG_SOURCE), name), kit.Simple(msg.Optionv(ice.MSG_TARGET))
msg.Log(kit.Select(tcp.RECV, tcp.ECHO, msg.Option(ice.MSG_HANDLE) == ice.TRUE), "%v->%v %v %v", source, target, msg.Detailv(), msg.FormatMeta())
msg.Log(kit.Select(tcp.RECV, tcp.ECHO, msg.Option(ice.MSG_HANDLE) == ice.TRUE), "%d %v->%v %v %v", len(b), source, target, msg.Detailv(), msg.FormatMeta())
if next := msg.Option(ice.MSG_TARGET); next == "" || len(target) == 0 {
msg.Go(func() {
if k := kit.Keys(msg.Option(ice.MSG_USERPOD), "_token"); msg.Option(k) != "" {
@ -226,9 +226,12 @@ func _space_exec(m *ice.Message, name string, source, target []string, c *websoc
}
func _space_echo(m *ice.Message, source, target []string, c *websocket.Conn) {
defer func() { m.WarnNotValid(recover()) }()
if m.Options(ice.MSG_SOURCE, source, ice.MSG_TARGET, target[1:]); !m.WarnNotValid(c.WriteMessage(1, []byte(m.FormatMeta()))) {
m.Options(ice.MSG_SOURCE, source, ice.MSG_TARGET, target[1:])
data := m.FormatMeta()
if !m.WarnNotValid(c.WriteMessage(1, []byte(data))) {
if source != nil {
m.Log(kit.Select(tcp.SEND, tcp.DONE, m.Option(ice.MSG_HANDLE) == ice.TRUE), "%v->%v %v %v", source, target, kit.ReplaceAll(kit.Format("%v", m.Detailv()), "\r\n", "\\r\\n", "\t", "\\t", "\n", "\\n"), m.FormatMeta())
m.Log(kit.Select(tcp.SEND, tcp.DONE, m.Option(ice.MSG_HANDLE) == ice.TRUE), "%d %v->%v %v %v", len(data), source, target,
kit.ReplaceAll(kit.Format("%v", m.Detailv()), "\r\n", "\\r\\n", "\t", "\\t", "\n", "\\n"), data)
}
}
}