fix(entitysource): rate limiter applied to nil reader (#2834)
This commit is contained in:
2
assets
2
assets
Submodule assets updated: 63c7abf214...d0540548cf
@@ -670,7 +670,7 @@ func (f *entitySource) getRsc(pos int64) (io.ReadCloser, error) {
|
|||||||
|
|
||||||
if f.o.SpeedLimit > 0 {
|
if f.o.SpeedLimit > 0 {
|
||||||
bucket := ratelimit.NewBucketWithRate(float64(f.o.SpeedLimit), f.o.SpeedLimit)
|
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 {
|
} else {
|
||||||
return file, nil
|
return file, nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user