Skip to content

Commit

Permalink
Use constructor.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeykiselev committed Dec 13, 2024
1 parent 3aa8a85 commit c08bace
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/networking/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ func (s *Session) readMessage(hdr Header) error {
func (s *Session) readMessagePayload(hdr Header, conn io.Reader) error {
// Wrap in a limited reader
s.logger.Debug("Reading message payload", "len", hdr.PayloadLength())
conn = &io.LimitedReader{R: conn, N: int64(hdr.PayloadLength())}
conn = io.LimitReader(conn, int64(hdr.PayloadLength()))

// Copy into buffer
s.receiveLock.Lock()
Expand Down

0 comments on commit c08bace

Please sign in to comment.