+2005-05-05 Hrvoje Niksic <hniksic@xemacs.org>
+
+ * retr.c (limit_bandwidth_reset): Reset sleep_adjust.
+ (limit_bandwidth): Don't allow huge "adjustment" values that
+ result from being suspended for a while.
+
2005-05-04 Hrvoje Niksic <hniksic@xemacs.org>
* wget.h: If gettext was found but libtintl.h wasn't, declare
{
limit_data.chunk_bytes = 0;
limit_data.chunk_start = 0;
+ limit_data.sleep_adjust = 0;
}
/* Limit the bandwidth by pausing the download for an amount of time.
desired and the actual sleep, and adjust the next sleep by
that amount. */
limit_data.sleep_adjust = slp - (t1 - t0);
+ /* If sleep_adjust is very large, it's likely due to suspension
+ and not clock inaccuracy. Don't enforce those. */
+ if (limit_data.sleep_adjust > 500)
+ limit_data.sleep_adjust = 500;
+ else if (limit_data.sleep_adjust < -500)
+ limit_data.sleep_adjust = -500;
}
limit_data.chunk_bytes = 0;