Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: fix bug #33

Merged
merged 2 commits into from
Jan 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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