Skip to content

Commit

Permalink
use io.ReadFull to read data from socket and pipe
Browse files Browse the repository at this point in the history
  • Loading branch information
rustatian committed Dec 10, 2020
1 parent 1cf8475 commit df6c7d1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pipe.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (rl *PipeRelay) Receive(frame *Frame) error {

// read the read payload
pb := make([]byte, header.ReadPayloadLen())
_, err = rl.in.Read(pb)
_, err = io.ReadFull(rl.in, pb)
if err != nil {
return errors.E(op, err)
}
Expand Down
2 changes: 1 addition & 1 deletion socket.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (rl *SocketRelay) Receive(frame *Frame) error {

// read the read payload
pb := make([]byte, header.ReadPayloadLen())
_, err = rl.rwc.Read(pb)
_, err = io.ReadFull(rl.rwc, pb)
if err != nil {
return errors.E(op, err)
}
Expand Down

0 comments on commit df6c7d1

Please sign in to comment.