mirror of https://github.com/cloudreve/Cloudreve
fix(entitysource): rate limiter applied to nil reader (#2834)
parent
a095117061
commit
a16b491f65
2
assets
2
assets
|
@ -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 {
|
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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue