Merge pull request #6183
3813a992
download: catch exceptions checking for size (moneromooo-monero)
This commit is contained in:
commit
bd4acbf44c
@ -107,6 +107,8 @@ namespace tools
|
|||||||
MINFO("Content-Length: " << length);
|
MINFO("Content-Length: " << length);
|
||||||
content_length = length;
|
content_length = length;
|
||||||
boost::filesystem::path path(control->path);
|
boost::filesystem::path path(control->path);
|
||||||
|
try
|
||||||
|
{
|
||||||
boost::filesystem::space_info si = boost::filesystem::space(path);
|
boost::filesystem::space_info si = boost::filesystem::space(path);
|
||||||
if (si.available < (size_t)content_length)
|
if (si.available < (size_t)content_length)
|
||||||
{
|
{
|
||||||
@ -115,6 +117,8 @@ namespace tools
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (const std::exception &e) { MWARNING("Failed to check for free space: " << e.what()); }
|
||||||
|
}
|
||||||
if (offset > 0)
|
if (offset > 0)
|
||||||
{
|
{
|
||||||
// we requested a range, so check if we're getting it, otherwise truncate
|
// we requested a range, so check if we're getting it, otherwise truncate
|
||||||
|
Loading…
Reference in New Issue
Block a user