mirror of
https://github.com/monero-project/monero.git
synced 2024-11-17 16:27:39 +00:00
download: catch exceptions checking for size
Happens on at least one windows box
This commit is contained in:
parent
fe3f6a3e6b
commit
3813a992e4
1 changed files with 9 additions and 5 deletions
|
@ -107,6 +107,8 @@ namespace tools
|
|||
MINFO("Content-Length: " << length);
|
||||
content_length = length;
|
||||
boost::filesystem::path path(control->path);
|
||||
try
|
||||
{
|
||||
boost::filesystem::space_info si = boost::filesystem::space(path);
|
||||
if (si.available < (size_t)content_length)
|
||||
{
|
||||
|
@ -115,6 +117,8 @@ namespace tools
|
|||
return false;
|
||||
}
|
||||
}
|
||||
catch (const std::exception &e) { MWARNING("Failed to check for free space: " << e.what()); }
|
||||
}
|
||||
if (offset > 0)
|
||||
{
|
||||
// we requested a range, so check if we're getting it, otherwise truncate
|
||||
|
|
Loading…
Reference in a new issue