mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
Fixed #22251: Terminated download gets new filename.
This commit is contained in:
parent
a9a38ed864
commit
653a658a58
@ -1,3 +1,15 @@
|
|||||||
|
2008-02-10 Micah Cowan <micah@cowan.name>
|
||||||
|
|
||||||
|
* http.c: Added existence_checked member to the http_stat
|
||||||
|
struct.
|
||||||
|
(gethttp): Mark hs->existence_checked when we've checked whether
|
||||||
|
a file-to-download exists; so we don't check it again if the
|
||||||
|
connection gets lost (and potentially pick a new "unique" name).
|
||||||
|
This fixes bug 22251.
|
||||||
|
* progress.c (create_image): Add space for an extra column in
|
||||||
|
the "eta" portion of the progress bar image; to deal with
|
||||||
|
too-long Czech translation.
|
||||||
|
|
||||||
2008-02-07 Micah Cowan <micah@cowan.name>
|
2008-02-07 Micah Cowan <micah@cowan.name>
|
||||||
|
|
||||||
* progress.c (create_image): Remove assertion on exceeding
|
* progress.c (create_image): Remove assertion on exceeding
|
||||||
|
@ -1291,6 +1291,10 @@ struct http_stat
|
|||||||
double dltime; /* time it took to download the data */
|
double dltime; /* time it took to download the data */
|
||||||
const char *referer; /* value of the referer header. */
|
const char *referer; /* value of the referer header. */
|
||||||
char *local_file; /* local file name. */
|
char *local_file; /* local file name. */
|
||||||
|
bool existence_checked; /* true if we already checked for a file's
|
||||||
|
existence after having begun to download
|
||||||
|
(needed in gethttp for when connection is
|
||||||
|
interrupted/restarted. */
|
||||||
bool timestamp_checked; /* true if pre-download time-stamping checks
|
bool timestamp_checked; /* true if pre-download time-stamping checks
|
||||||
* have already been performed */
|
* have already been performed */
|
||||||
char *orig_file_name; /* name of file to compare for time-stamping
|
char *orig_file_name; /* name of file to compare for time-stamping
|
||||||
@ -1807,7 +1811,7 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* TODO: perform this check only once. */
|
/* TODO: perform this check only once. */
|
||||||
if (file_exists_p (hs->local_file))
|
if (!hs->existence_checked && file_exists_p (hs->local_file))
|
||||||
{
|
{
|
||||||
if (opt.noclobber)
|
if (opt.noclobber)
|
||||||
{
|
{
|
||||||
@ -1833,6 +1837,7 @@ File `%s' already there; not retrieving.\n\n"), hs->local_file);
|
|||||||
hs->local_file = unique;
|
hs->local_file = unique;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
hs->existence_checked = true;
|
||||||
|
|
||||||
/* Support timestamping */
|
/* Support timestamping */
|
||||||
/* TODO: move this code out of gethttp. */
|
/* TODO: move this code out of gethttp. */
|
||||||
|
@ -874,12 +874,12 @@ create_image (struct bar_progress *bp, double dl_total_time, bool done)
|
|||||||
"[]" - progress bar decorations - 2 chars
|
"[]" - progress bar decorations - 2 chars
|
||||||
" nnn,nnn,nnn" - downloaded bytes - 12 chars or very rarely more
|
" nnn,nnn,nnn" - downloaded bytes - 12 chars or very rarely more
|
||||||
" 12.5K/s" - download rate - 8 chars
|
" 12.5K/s" - download rate - 8 chars
|
||||||
" eta 36m 51s" - ETA - 13 chars
|
" eta 36m 51s" - ETA - 14 chars
|
||||||
|
|
||||||
"=====>..." - progress bar - the rest
|
"=====>..." - progress bar - the rest
|
||||||
*/
|
*/
|
||||||
int dlbytes_size = 1 + MAX (size_grouped_len, 11);
|
int dlbytes_size = 1 + MAX (size_grouped_len, 11);
|
||||||
int progress_size = bp->width - (4 + 2 + dlbytes_size + 8 + 13);
|
int progress_size = bp->width - (4 + 2 + dlbytes_size + 8 + 14);
|
||||||
|
|
||||||
if (progress_size < 5)
|
if (progress_size < 5)
|
||||||
progress_size = 0;
|
progress_size = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user