If the transfer timed out, but we don't know how large the file is supposed
to be, assume it was truncated.
This commit is contained in:
parent
6bbbd64fc4
commit
30204f9830
|
@ -388,7 +388,7 @@ fetch(char *URL, char *path)
|
|||
|
||||
stat_end(&xs);
|
||||
|
||||
/* Set mtime of local file */
|
||||
/* set mtime of local file */
|
||||
if (!n_flag && us.mtime && !o_stdout
|
||||
&& (stat(path, &sb) != -1) && sb.st_mode & S_IFREG) {
|
||||
struct timeval tv[2];
|
||||
|
@ -427,6 +427,15 @@ fetch(char *URL, char *path)
|
|||
goto failure_keep;
|
||||
}
|
||||
|
||||
/*
|
||||
* If the transfer timed out and we didn't know how much to
|
||||
* expect, assume the worst (i.e. we didn't get all of it)
|
||||
*/
|
||||
if (sigalrm && us.size == -1) {
|
||||
warnx("%s may be truncated", path);
|
||||
goto failure_keep;
|
||||
}
|
||||
|
||||
success:
|
||||
r = 0;
|
||||
goto done;
|
||||
|
|
Loading…
Reference in New Issue