Skip to content

Commit

Permalink
feat: fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
xingshan committed Jan 8, 2022
1 parent 1de67e6 commit e2f90e6
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions go-plugin/pkg/protocol/dubbo/decoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,28 +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
}
meta = m
// 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
}
meta = m
// 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 e2f90e6

Please sign in to comment.