fix(entitysource): rate limiter applied to nil reader (#2834)

dependabot/go_modules/github.com/ulikunitz/xz-0.5.14
Aaron Liu 1 week ago
parent a095117061
commit a16b491f65

@ -1 +1 @@
Subproject commit 63c7abf214d94995ed02491d412971ae2bf2996b
Subproject commit d0540548cfb2caeec0c7d44e85819c833fdeda0f

@ -670,7 +670,7 @@ func (f *entitySource) getRsc(pos int64) (io.ReadCloser, error) {
if f.o.SpeedLimit > 0 {
bucket := ratelimit.NewBucketWithRate(float64(f.o.SpeedLimit), f.o.SpeedLimit)
return lrs{f.rsc, ratelimit.Reader(f.rsc, bucket)}, nil
return lrs{file, ratelimit.Reader(file, bucket)}, nil
} else {
return file, nil
}

Loading…
Cancel
Save