Skip to content

Commit

Permalink
Return 0 written bytes on write error
Browse files Browse the repository at this point in the history
Return 0 written bytes on write error
  • Loading branch information
cnderrauber committed Dec 10, 2024
1 parent abb6bea commit 85eac31
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,9 @@ func (s *Stream) WriteSCTP(p []byte, ppi PayloadProtocolIdentifier) (int, error)
if s.association.isBlockWrite() {
s.writeLock.Unlock()
}
if err != nil {
n = 0
}

Check warning on line 300 in stream.go

View check run for this annotation

Codecov / codecov/patch

stream.go#L299-L300

Added lines #L299 - L300 were not covered by tests
return n, err
}

Expand Down

0 comments on commit 85eac31

Please sign in to comment.