Skip to content

Commit

Permalink
Merge pull request #33 from YIDWang/master
Browse files Browse the repository at this point in the history
feat: fix bug
  • Loading branch information
YIDWang authored Jan 8, 2022
2 parents a87c65d + e2f90e6 commit 948c2be
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions go-plugin/pkg/protocol/dubbo/decoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,26 +110,19 @@ func decodeFrame(ctx context.Context, data api.IoBuffer) (cmd interface{}, err e
func getServiceAwareMeta(ctx context.Context, frame *Frame) (map[string]string, error) {
meta := make(map[string]string, 8)
switch frame.SerializationId {
//dubbo encode by Hessian
case 2:
m, err2 := decodeHessian(ctx, frame, meta)
if err2 != nil {
return m, err2
}
// dubbo decode by fastson
//dubbo encode by Hessian
return decodeHessian(ctx, frame, meta)
case 6:
m, err2 := decodeFastjosn(ctx, frame, meta)
if err2 != nil {
return m, err2
}
// dubbo decode by fastson
return decodeFastjosn(ctx, frame, meta)
default:
return meta, nil
}
return meta, nil
}

func decodeHessian(ctx context.Context, frame *Frame, meta map[string]string) (map[string]string, error) {

meta = make(map[string]string, 8)
if frame.SerializationId != 2 {
// not hessian , do not support
Expand Down

0 comments on commit 948c2be

Please sign in to comment.