case TR_STATUS_DOWNLOAD:
if (tor->etaDLSpeedCalculatedAt + 800 < now)
{
- tor->etaDLSpeedCalculatedAt = now;
tor->etaDLSpeed_Bps = tor->etaDLSpeedCalculatedAt + 4000 < now ?
pieceDownloadSpeed_Bps : /* if no recent previous speed, no need to smooth */
(tor->etaDLSpeed_Bps * 4.0 + pieceDownloadSpeed_Bps) / 5.0; /* smooth across 5 readings */
+ tor->etaDLSpeedCalculatedAt = now;
}
if (s->leftUntilDone > s->desiredAvailable && tor->info.webseedCount < 1)
{
if (tor->etaULSpeedCalculatedAt + 800 < now)
{
- tor->etaULSpeedCalculatedAt = now;
tor->etaULSpeed_Bps = tor->etaULSpeedCalculatedAt + 4000 < now ?
pieceUploadSpeed_Bps : /* if no recent previous speed, no need to smooth */
(tor->etaULSpeed_Bps * 4.0 + pieceUploadSpeed_Bps) / 5.0; /* smooth across 5 readings */
+ tor->etaULSpeedCalculatedAt = now;
}
if (tor->etaULSpeed_Bps == 0)