fix: server 修复慢消息导致堆栈溢出的问题

This commit is contained in:
kercylan98 2023-09-18 14:53:43 +08:00
parent d56c1df6e1
commit e95e1ba399
1 changed files with 4 additions and 0 deletions

View File

@ -89,6 +89,10 @@ func (slf *Message) MessageType() MessageType {
func (slf *Message) AttrsString() string {
var attrs = make([]any, 0, len(slf.attrs))
for _, attr := range slf.attrs {
if conn, hit := attr.(*Conn); hit {
attrs = append(attrs, conn.GetID())
continue
}
if tof := reflect.TypeOf(attr); tof.Kind() == reflect.Func {
attrs = append(attrs, tof.String())
continue