diff --git a/protocol/dubbo/codec.go b/protocol/dubbo/codec.go index 4125509259a04e67ba6a1f569b04343f26a9d2cf..dcddd0ea65e66670de4bc519fa0baacf6dbd2234 100644 --- a/protocol/dubbo/codec.go +++ b/protocol/dubbo/codec.go @@ -79,6 +79,10 @@ func (p *DubboPackage) Unmarshal(buf *bytes.Buffer, opts ...interface{}) error { // read header err := codec.ReadHeader(&p.Header) if err != nil { + if p.Header.Type&hessian.PackageError != hessian.PackageType(hessian.Zero) { + p.Body = &hessian.Response{Exception: err} + return nil + } return perrors.WithStack(err) } diff --git a/protocol/dubbo/readwriter.go b/protocol/dubbo/readwriter.go index 647bc9cb5e3a2875daff4f855e8b1b5cfe7f4ecb..fd7c7c317d7eca8be9df7f7646b9d191300233fc 100644 --- a/protocol/dubbo/readwriter.go +++ b/protocol/dubbo/readwriter.go @@ -19,7 +19,6 @@ package dubbo import ( "bytes" - "fmt" "reflect" ) @@ -165,6 +164,6 @@ func (p *RpcServerPackageHandler) Write(ss getty.Session, pkg interface{}) error logger.Warnf("binary.Write(res{%#v}) = err{%#v}", res, perrors.WithStack(err)) return perrors.WithStack(err) } - fmt.Println("eofefe", buf.Len()) + return perrors.WithStack(ss.WriteBytes(buf.Bytes())) }