* 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:
rakshasa
2006-11-21 14:05:36 +00:00
parent 4819162ffa
commit e3f59ee9e4
4 changed files with 19 additions and 25 deletions
+2 -8
View File
@@ -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;