mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-12 13:12:32 +00:00
* 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:
+1
-18
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user