Skip to content

Commit

Permalink
fix: set total length when encode ttheader
Browse files Browse the repository at this point in the history
  • Loading branch information
ppzqh committed Jan 31, 2024
1 parent 20b9045 commit 3913da7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/remote/codec/default_codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ func (c *defaultCodec) EncodeMetaAndPayload(ctx context.Context, message remote.
return nil
}

// EncodeMetaAndPayloadWithCRC32C encode payload and meta with crc32c checksum of the payload.
func (c *defaultCodec) EncodeMetaAndPayloadWithCRC32C(ctx context.Context, message remote.Message, out remote.ByteBuffer, me remote.MetaEncoder) error {
var err error

Expand All @@ -186,7 +187,7 @@ func (c *defaultCodec) EncodeMetaAndPayloadWithCRC32C(ctx context.Context, messa
message.SetPayloadLen(len(payload))

// 2. encode header and return totalLenField if needed
// totalLenField will be filled after payload encoded
// In this case, set total length during TTHeader encode
if _, err = ttHeaderCodec.encode(ctx, message, out); err != nil {
return err
}
Expand Down

0 comments on commit 3913da7

Please sign in to comment.