let trusted size ask for more packets
This commit is contained in:
@@ -128,7 +128,8 @@ export const getFailedPacketIndeces = () => {
|
|||||||
}
|
}
|
||||||
export const getNeededPacketIndeces = () => {
|
export const getNeededPacketIndeces = () => {
|
||||||
let packetCount;
|
let packetCount;
|
||||||
if(!isSizeTrusted()) {
|
let sizeTrusted = isSizeTrusted();
|
||||||
|
if(!sizeTrusted) {
|
||||||
packetCount = getFailedPacketIndeces().reduce((max, i) => Math.max(max, i));
|
packetCount = getFailedPacketIndeces().reduce((max, i) => Math.max(max, i));
|
||||||
} else {
|
} else {
|
||||||
packetCount = countExpectedPackets();
|
packetCount = countExpectedPackets();
|
||||||
@@ -148,7 +149,9 @@ export const getNeededPacketIndeces = () => {
|
|||||||
if(SUCCESS_SEQUENCES.includes(i)) continue;
|
if(SUCCESS_SEQUENCES.includes(i)) continue;
|
||||||
indeces.push(i);
|
indeces.push(i);
|
||||||
// cut off in case a failed packet returned a high number
|
// cut off in case a failed packet returned a high number
|
||||||
if(indeces.length > 20) break;
|
if(!sizeTrusted && indeces.length >= 10) break;
|
||||||
|
// lets not ask for too much
|
||||||
|
if(indeces.length >= 50) break;
|
||||||
}
|
}
|
||||||
return indeces;
|
return indeces;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user