forked from x/icebergs
add some
This commit is contained in:
parent
0bff96f485
commit
c4b9641a5e
@ -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) })
|
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))
|
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 {
|
if next := msg.Option(ice.MSG_TARGET); next == "" || len(target) == 0 {
|
||||||
msg.Go(func() {
|
msg.Go(func() {
|
||||||
if k := kit.Keys(msg.Option(ice.MSG_USERPOD), "_token"); msg.Option(k) != "" {
|
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) {
|
func _space_echo(m *ice.Message, source, target []string, c *websocket.Conn) {
|
||||||
defer func() { m.WarnNotValid(recover()) }()
|
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 {
|
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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user