* Fix the use of strlcpy.

* Allow lists as arguments in commands by using '{' and '}'. The list
will be recursed and all '$' will be called, while '~' will only be
expanded when in the first element in the list. E.g "execute =
touch,{~/tmp/,$get_client_version=}"

* Added rak::path_expand that works on char buffers.

* Fixed RequestList::calculate_pipe_size so it doesn't request too
many pieces from fast peers.

* Added 'execute_log' for logging the result of calls to 'execute'.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@952 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2007-08-12 13:41:50 +00:00
parent 781e1ca7dc
commit 788b496241
9 changed files with 207 additions and 78 deletions
+1 -18
View File
@@ -111,24 +111,7 @@ apply_view_list(const torrent::Object&) {
torrent::Object
apply_print(const torrent::Object& rawArgs) {
char buffer[1024];
char* current = buffer;
for (torrent::Object::list_type::const_iterator itr = rawArgs.as_list().begin(), last = rawArgs.as_list().end(); itr != last; itr++) {
switch (itr->type()) {
case torrent::Object::TYPE_STRING:
{
int len = std::min<int>(itr->as_string().size(), buffer + 1024 - current);
std::memcpy(current, itr->as_string().c_str(), len + 1);
current += len;
break;
}
case torrent::Object::TYPE_VALUE:
default:
current += snprintf(current, buffer + 1024 - current, "%lli", itr->as_value());
break;
}
}
rpc::print_object(buffer, buffer + 1024, &rawArgs, 0);
control->core()->push_log(buffer);
return torrent::Object();