mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-10 12:12:31 +00:00
* Replaced the old File with the EntryListNode code, and cleaned it
up. The user now uses File* instead of File. * Changed apply_low_diskspace to use torrent::Download::free_diskspace() instead of the old file path hack. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@809 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -175,17 +175,11 @@ apply_close_low_diskspace(Control* m, int64_t arg) {
|
||||
core::Manager::DListItr itr = m->core()->download_list()->begin();
|
||||
|
||||
while ((itr = std::find_if(itr, m->core()->download_list()->end(), std::mem_fun(&core::Download::is_downloading))) != m->core()->download_list()->end()) {
|
||||
rak::fs_stat stat;
|
||||
std::string path = (*itr)->file_list()->root_dir() + (*itr)->file_list()->get(0).path()->as_string();
|
||||
|
||||
if (!stat.update(path)) {
|
||||
m->core()->push_log(std::string("Cannot read free diskspace: ") + strerror(errno) + " for " + path);
|
||||
|
||||
} else if (stat.bytes_avail() < arg) {
|
||||
if ((*itr)->download()->free_diskspace() < (uint64_t)arg) {
|
||||
m->core()->download_list()->close(*itr);
|
||||
|
||||
(*itr)->set_hash_failed(true);
|
||||
(*itr)->set_message(std::string("Low diskspace"));
|
||||
(*itr)->set_message(std::string("Low diskspace."));
|
||||
}
|
||||
|
||||
++itr;
|
||||
|
||||
Reference in New Issue
Block a user