Don't allow partial file downloads.

This is particularly annoying with the proj.k.o support, as a
half-downloaded XML file is 100% invalid, and will cause XML::Parser to
throw an exception.
wilder
Michael Pyne 15 years ago
parent 51bb968c1e
commit 3ee1ef6443
  1. 10
      kdesrc-build

@ -1753,6 +1753,14 @@ sub download_http_file
return 0;
};
# Don't allow partial downloads
local $SIG{'INT'} = sub {
unlink($filename);
close OUTPUT;
$conn->close();
die make_exception('Runtime', "Interrupted while downloading $filename");
};
my ($buf, $result);
while (1)
{
@ -1763,7 +1771,7 @@ sub download_http_file
$conn->close();
close OUTPUT;
safe_unlink($filename);
unlink($filename);
return 0;
}

Loading…
Cancel
Save