Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Fix hiding of errors in SecureChannel.readChunk #551

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion uasc/secure_channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,8 @@ 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 {

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