Skip to content

Commit

Permalink
fixes the hiding of errors in readChunk
Browse files Browse the repository at this point in the history
  • Loading branch information
Robin Wiersig committed Jan 25, 2022
1 parent a3e41d3 commit a799d0e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion uasc/secure_channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,9 @@ func (s *SecureChannel) receive(ctx context.Context) *response {
func (s *SecureChannel) readChunk() (*MessageChunk, error) {
// read a full message from the underlying conn.
b, err := s.c.Receive()
if err == io.EOF || len(b) == 0 {

sliceIsEmpty := b != nil && len(b) == 0
if err == io.EOF || sliceIsEmpty {
return nil, io.EOF
}
// do not wrap this error since it hides conn error
Expand Down

0 comments on commit a799d0e

Please sign in to comment.