Skip to content

Commit

Permalink
Do not miss source stream being consumed just because of errors
Browse files Browse the repository at this point in the history
  • Loading branch information
pontus committed Jan 19, 2024
1 parent 27ae850 commit 12abe57
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion streaming/in.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,8 @@ func (c *crypt4GHInternalReader) fillBuffer() error {
// reader should be positioned before the needed segment now

read, err := io.ReadFull(c.reader, encryptedSegmentBytes)
c.sourcePos += int64(read)

if err != nil && err != io.ErrUnexpectedEOF {
return err
}
Expand All @@ -391,7 +393,6 @@ func (c *crypt4GHInternalReader) fillBuffer() error {
return err
}
c.lastDecryptedSegment = neededSegment
c.sourcePos += int64(read)

// Keep track of how much data is directly available

Expand Down

0 comments on commit 12abe57

Please sign in to comment.