This commit is contained in:
@ -547,9 +547,8 @@ auto open_file::read(std::size_t read_size, std::uint64_t read_offset,
|
|||||||
return set_api_error(api_error::invalid_operation);
|
return set_api_error(api_error::invalid_operation);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto res = check_allocation();
|
if (stop_requested_) {
|
||||||
if (res != api_error::success) {
|
return set_api_error(api_error::download_stopped);
|
||||||
return res;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
read_size =
|
read_size =
|
||||||
@ -558,6 +557,11 @@ auto open_file::read(std::size_t read_size, std::uint64_t read_offset,
|
|||||||
return api_error::success;
|
return api_error::success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto res = check_allocation();
|
||||||
|
if (res != api_error::success) {
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
const auto read_from_source = [this, &data, &read_offset,
|
const auto read_from_source = [this, &data, &read_offset,
|
||||||
&read_size]() -> api_error {
|
&read_size]() -> api_error {
|
||||||
return do_io([this, &data, &read_offset, &read_size]() -> api_error {
|
return do_io([this, &data, &read_offset, &read_size]() -> api_error {
|
||||||
|
Reference in New Issue
Block a user