We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9c768d7 commit ff04022Copy full SHA for ff04022
mongo/gridfs/download_stream.go
@@ -11,10 +11,9 @@ import (
11
12
"errors"
13
14
- "time"
15
-
16
"io"
17
"math"
+ "time"
18
19
"go.mongodb.org/mongo-driver/mongo"
20
)
@@ -188,7 +187,7 @@ func (ds *DownloadStream) fillBuffer(ctx context.Context) error {
188
187
bytesLen := int32(len(dataBytes))
189
if ds.expectedChunk == ds.numChunks {
190
// final chunk can be fewer than ds.chunkSize bytes
191
- bytesDownloaded := ds.chunkSize * (ds.expectedChunk - 1)
+ bytesDownloaded := int64(ds.chunkSize) * (int64(ds.expectedChunk) - int64(1))
192
bytesRemaining := ds.fileLen - int64(bytesDownloaded)
193
194
if int64(bytesLen) != bytesRemaining {
0 commit comments