mirror of
https://github.com/internetarchive/heritrix3.git
synced 2026-10-02 10:27:46 +00:00
fix off-by-one mistake with integer arithmetic so RecordingInputStreamTest.testReadFullyOrUntil() test passes (how does this pass on master?)
This commit is contained in:
@@ -306,8 +306,8 @@ public class RecordingOutputStream extends OutputStream {
|
||||
if(duration>timeoutMs) {
|
||||
throw new RecorderTimeoutException();
|
||||
}
|
||||
// need to throttle reading to hit max configured rate?
|
||||
if(position/duration > maxRateBytesPerMs) {
|
||||
// need to throttle reading to hit max configured rate?
|
||||
if(position/duration >= maxRateBytesPerMs) {
|
||||
long desiredDuration = position / maxRateBytesPerMs;
|
||||
try {
|
||||
Thread.sleep(desiredDuration-duration);
|
||||
|
||||
Reference in New Issue
Block a user