mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-14 14:12:31 +00:00
set d.message on hash check failure
Use Download::hash_error_message() to get a descriptive error string when hash check fails due to I/O error, instead of relying on errno which could be zero. Also fix Manager::receive_hashing_changed() where set_hash_failed(true) was called without setting d.message when catching local_error during hash check (e.g. 'too many open files').
This commit is contained in:
@@ -492,7 +492,11 @@ DownloadList::hash_done(Download* download) {
|
||||
|
||||
if (!download->is_hash_checked()) {
|
||||
download->set_hash_failed(true);
|
||||
|
||||
|
||||
auto& msg = download->download()->hash_error_message();
|
||||
if (!msg.empty())
|
||||
download->set_message(msg);
|
||||
|
||||
DL_TRIGGER_EVENT(download, "event.download.hash_failed");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -513,6 +513,7 @@ Manager::receive_hashing_changed() {
|
||||
|
||||
} else {
|
||||
(*itr)->set_hash_failed(true);
|
||||
(*itr)->set_message("Hashing failed: " + std::string(e.what()));
|
||||
lt_log_print(torrent::LOG_TORRENT_ERROR, "Hashing failed: %s", e.what());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user