Skip to content

Commit

Permalink
Fixed buffer resize when writing request on connection (#374)
Browse files Browse the repository at this point in the history
  • Loading branch information
merlimat authored Oct 1, 2020
1 parent 3c523ba commit 7dd67c9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pulsar/internal/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,7 @@ func (c *connection) writeCommand(cmd *pb.BaseCommand) {
c.writeBuffer.WriteUint32(frameSize)

c.writeBuffer.WriteUint32(cmdSize)
c.writeBuffer.ResizeIfNeeded(cmdSize)
_, err := cmd.MarshalToSizedBuffer(c.writeBuffer.WritableSlice()[:cmdSize])
if err != nil {
c.log.WithError(err).Fatal("Protobuf serialization error")
Expand Down

0 comments on commit 7dd67c9

Please sign in to comment.