//there's no "min interval" returned, so start the re-announce backoff timings at 15min
if( failure_added_time < 900 ) failure_added_time = 900;
secs_to_wait = getErrorRetryInterval();
if (Logger.isEnabled()) {
Logger.log(new LogEvent(torrent, LOGID,
"MIN INTERVAL CALC: tracker reported error, " +
"adjusting to error retry interval"));
}
}
else { //tracker is OFFLINE
secs_to_wait = getErrorRetryInterval();
if (Logger.isEnabled()) {
Logger.log(new LogEvent(torrent, LOGID,
"MIN INTERVAL CALC: tracker seems to be offline, " +
"adjusting to error retry interval"));
}
}
}
else{
if( rd_override_percentage == 0 ) {
if (Logger.isEnabled())
Logger.log(new LogEvent(torrent, LOGID,
"MIN INTERVAL CALC: override, perc = 0"));
return TRTrackerAnnouncer.REFRESH_MINIMUM_SECS;
}
if (rd_override_percentage != 100) {
secs_to_wait = (secs_to_wait * rd_override_percentage) /100;
if (Logger.isEnabled()) {
Logger.log(new LogEvent(torrent, LOGID,
"MIN INTERVAL CALC: override, perc = " + rd_override_percentage));
}
}
if ( secs_to_wait < TRTrackerAnnouncer.REFRESH_MINIMUM_SECS ){
secs_to_wait = TRTrackerAnnouncer.REFRESH_MINIMUM_SECS;
}
//use 'min interval' for calculation
if( min_interval != 0 && secs_to_wait < min_interval ) {
float percentage = (float)min_interval / current_time_to_wait_secs; //percentage of original interval
//long orig_override = secs_to_wait;
int added_secs = (int)((min_interval - secs_to_wait) * percentage); //increase by x percentage of difference
secs_to_wait += added_secs;
if (Logger.isEnabled())
Logger.log(new LogEvent(torrent, LOGID,
"MIN INTERVAL CALC: min_interval=" + min_interval + ", interval="
+ current_time_to_wait_secs + ", orig=" + current_time_to_wait_secs
+ ", new=" + secs_to_wait + ", added=" + added_secs
+ ", perc=" + percentage));
}