From f546b479f7bc093428fc24ee4f28c309d7409a7e Mon Sep 17 00:00:00 2001 From: jayantxie Date: Fri, 20 Dec 2024 17:09:44 +0800 Subject: [PATCH] fix: binary generic server returning biz err failed --- pkg/generic/thrift/binary.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/generic/thrift/binary.go b/pkg/generic/thrift/binary.go index a30f4676e3..90c12fdf74 100644 --- a/pkg/generic/thrift/binary.go +++ b/pkg/generic/thrift/binary.go @@ -20,6 +20,7 @@ import ( "context" "github.com/cloudwego/gopkg/bufiox" + "github.com/cloudwego/gopkg/protocol/thrift" "github.com/cloudwego/gopkg/protocol/thrift/base" ) @@ -31,5 +32,10 @@ func NewWriteBinary() *WriteBinary { } func (w *WriteBinary) Write(ctx context.Context, out bufiox.Writer, msg interface{}, method string, isClient bool, requestBase *base.Base) error { + bw := thrift.NewBufferWriter(out) + defer bw.Recycle() + if err := bw.WriteFieldStop(); err != nil { + return err + } return nil }