Skip to content

Commit

Permalink
fix(generic): binary generic server returning biz err failed (#1648)
Browse files Browse the repository at this point in the history
  • Loading branch information
jayantxie authored Dec 23, 2024
1 parent 8a7d120 commit c50055a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/generic/thrift/binary.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"context"

"github.com/cloudwego/gopkg/bufiox"
"github.com/cloudwego/gopkg/protocol/thrift"
"github.com/cloudwego/gopkg/protocol/thrift/base"
)

Expand All @@ -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
}

0 comments on commit c50055a

Please sign in to comment.