From a4c3e02e07a6cd98ba496b89bc690f9b07064123 Mon Sep 17 00:00:00 2001 From: pangdogs Date: Wed, 24 Jul 2024 19:02:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/dserv/distservice.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/dserv/distservice.go b/plugins/dserv/distservice.go index e3771851..0123e542 100644 --- a/plugins/dserv/distservice.go +++ b/plugins/dserv/distservice.go @@ -233,13 +233,13 @@ func (d *_DistService) SendMsg(dst string, msg gap.Msg) error { seq = d.deduplication.Make() } - buf, err := d.encoder.Encode(d.servCtx.GetName(), d.details.LocalAddr, seq, msg) + mpBuf, err := d.encoder.Encode(d.servCtx.GetName(), d.details.LocalAddr, seq, msg) if err != nil { return err } - defer buf.Release() + defer mpBuf.Release() - return d.broker.Publish(d.ctx, dst, buf.Data()) + return d.broker.Publish(d.ctx, dst, mpBuf.Data()) } // ForwardMsg 转发消息 @@ -248,13 +248,13 @@ func (d *_DistService) ForwardMsg(svc, src, dst string, seq int64, msg gap.Msg) return fmt.Errorf("%w: msg is nil", core.ErrArgs) } - buf, err := d.encoder.Encode(svc, src, seq, msg) + mpBuf, err := d.encoder.Encode(svc, src, seq, msg) if err != nil { return err } - defer buf.Release() + defer mpBuf.Release() - return d.broker.Publish(d.ctx, dst, buf.Data()) + return d.broker.Publish(d.ctx, dst, mpBuf.Data()) } // WatchMsg 监听消息(优先级高)