* Fix potential buffer overflows in case snprintf buffer is too

small. Patch by Josef Drexler.

* Added 'view.persistance' command that makes downloads inserted into
that view persist across sessions. Only call on user-created views.

* Added 'ratio.*' commands that call the 'group.seeding.ratio.*'
equivalents.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1080 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2008-11-16 07:54:45 +00:00
parent de8a11c4fd
commit 7600a51039
13 changed files with 161 additions and 25 deletions
+2 -2
View File
@@ -122,7 +122,7 @@ apply_on_ratio(const torrent::Object& rawArgs) {
if (!(*itr)->is_seeding() || rpc::call_command_value("d.get_ignore_commands", rpc::make_target(*itr)) != 0)
continue;
rpc::parse_command_single(rpc::make_target(*itr), "print={Checked ratio of download.}");
// rpc::parse_command_single(rpc::make_target(*itr), "print={Checked ratio of download.}");
int64_t totalDone = (*itr)->download()->bytes_done();
int64_t totalUpload = (*itr)->download()->up_rate()->total();
@@ -137,7 +137,7 @@ apply_on_ratio(const torrent::Object& rawArgs) {
std::strcpy(bufferStart, "command");
for (std::vector<core::Download*>::iterator itr = downloads.begin(), last = downloads.end(); itr != last; itr++) {
rpc::commands.call("print", rpc::make_target(*itr), "Calling ratio command.");
// rpc::commands.call("print", rpc::make_target(*itr), "Calling ratio command.");
rpc::commands.call_catch(buffer, rpc::make_target(*itr), torrent::Object(), "Ratio reached, but command failed: ");
}