refactor
This commit is contained in:
parent
f5b4928818
commit
a77fd75687
@ -58,7 +58,15 @@ auto http_put_file::set_method(CURL *curl, stop_type &stop_requested) const
|
||||
return false;
|
||||
}
|
||||
|
||||
auto file_size = read_info->file->size().value_or(0U);
|
||||
auto opt_size = read_info->file->size();
|
||||
if (not opt_size.has_value()) {
|
||||
utils::error::raise_url_error(
|
||||
function_name, get_path(), source_path,
|
||||
std::runtime_error("failed to get file size"));
|
||||
return false;
|
||||
}
|
||||
|
||||
auto file_size = opt_size.value();
|
||||
if (file_size == 0U) {
|
||||
curl_easy_setopt(curl, CURLOPT_INFILESIZE, 0L);
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user