Skip to content
Snippets Groups Projects
Commit 628a45bf authored by fangyincheng's avatar fangyincheng
Browse files

Fix: readHeader error

parent 3c514717
No related branches found
No related tags found
No related merge requests found
......@@ -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)
}
......
......@@ -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()))
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment