Skip to content

Commit

Permalink
chore: release v0.4.1 (#621)
Browse files Browse the repository at this point in the history
  • Loading branch information
alice-yyds authored Aug 29, 2022
1 parent 4a7219a commit 995948d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions pkg/remote/codec/default_codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,14 @@ func (c *defaultCodec) Decode(ctx context.Context, message remote.Message, in re
}

// 2. decode body
hasRead := in.ReadLen()
if err = c.decodePayload(ctx, message, in); err != nil {
return err
}
if message.PayloadLen() == 0 {
// if protocol is PurePayload, should set payload length after decoded
message.SetPayloadLen(in.ReadLen() - hasRead)
}
return nil
}

Expand Down
1 change: 1 addition & 0 deletions pkg/remote/codec/protobuf/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ func (c *grpcCodec) Decode(ctx context.Context, message remote.Message, in remot
if err != nil {
return err
}
message.SetPayloadLen(dLen)
data := message.Data()
switch t := data.(type) {
case fastpb.Reader:
Expand Down
3 changes: 1 addition & 2 deletions pkg/remote/trans/detection/server_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@ func (t *svrTransHandler) OnRead(ctx context.Context, conn net.Conn) error {

func (t *svrTransHandler) OnInactive(ctx context.Context, conn net.Conn) {
// t.http2 should use the ctx returned by OnActive in r.ctx
r := ctx.Value(handlerKey{}).(*handlerWrapper)
if r.ctx != nil {
if r, ok := ctx.Value(handlerKey{}).(*handlerWrapper); ok && r.ctx != nil {
ctx = r.ctx
}
t.which(ctx).OnInactive(ctx, conn)
Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ package kitex
// Name and Version info of this framework, used for statistics and debug
const (
Name = "Kitex"
Version = "v0.4.0"
Version = "v0.4.1"
)

0 comments on commit 995948d

Please sign in to comment.