fix
This commit is contained in:
@@ -93,12 +93,12 @@ auto direct_open_file::download_chunk(std::size_t chunk,
|
|||||||
return unlock_and_return(api_error::invalid_ring_buffer_position);
|
return unlock_and_return(api_error::invalid_ring_buffer_position);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (active_downloads_.find(chunk) != active_downloads_.end()) {
|
if (get_active_downloads().find(chunk) != get_active_downloads().end()) {
|
||||||
if (skip_active) {
|
if (skip_active) {
|
||||||
return unlock_and_return(api_error::success);
|
return unlock_and_return(api_error::success);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto active_download = active_downloads_.at(chunk);
|
auto active_download = get_active_downloads().at(chunk);
|
||||||
unlock_and_notify();
|
unlock_and_notify();
|
||||||
|
|
||||||
return active_download->wait();
|
return active_download->wait();
|
||||||
@@ -109,7 +109,7 @@ auto direct_open_file::download_chunk(std::size_t chunk,
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto active_download{std::make_shared<download>()};
|
auto active_download{std::make_shared<download>()};
|
||||||
active_downloads_[chunk] = active_download;
|
get_active_downloads()[chunk] = active_download;
|
||||||
|
|
||||||
auto &buffer = ring_data_.at(chunk % ring_state_.size());
|
auto &buffer = ring_data_.at(chunk % ring_state_.size());
|
||||||
auto data_offset{chunk * get_chunk_size()};
|
auto data_offset{chunk * get_chunk_size()};
|
||||||
@@ -131,7 +131,7 @@ auto direct_open_file::download_chunk(std::size_t chunk,
|
|||||||
progress);
|
progress);
|
||||||
}
|
}
|
||||||
|
|
||||||
active_downloads_.erase(chunk);
|
get_active_downloads().erase(chunk);
|
||||||
unlock_and_notify();
|
unlock_and_notify();
|
||||||
|
|
||||||
active_download->notify(res);
|
active_download->notify(res);
|
||||||
|
Reference in New Issue
Block a user