+2001-11-23 Hrvoje Niksic <hniksic@arsdigita.com>
+
+ * progress.c (bar_update): If the downloaded amount becomes larger
+ than the expected amount, adjust the expected amount accordingly.
+
2001-11-23 Hrvoje Niksic <hniksic@arsdigita.com>
* utils.c (determine_screen_width): New function.
long dltime = wtimer_elapsed (bp->timer);
bp->count += howmuch;
+ if (bp->count + bp->initial_length > bp->total_length)
+ /* We could be downloading more than total_length, e.g. when the
+ server sends an incorrect Content-Length header. In that case,
+ adjust bp->total_length to the new reality, so that the code in
+ create_image() that depends on total size being smaller or
+ equal to the expected size doesn't abort. */
+ bp->total_length = bp->count + bp->initial_length;
if (screen_width != bp->width)
{