From 2f485cdf428d61741ddab91d2a0900a66b649a09 Mon Sep 17 00:00:00 2001 From: rakshasa Date: Sat, 7 May 2011 04:57:47 +0000 Subject: [PATCH] * Fixed 'and' and 'or' commands. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1225 e378c898-3ddf-0310-93e7-cc216c733640 --- doc/log_stats.plot | 28 +++++++++++++++++++++------- src/command_ui.cc | 9 +++++++++ 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/doc/log_stats.plot b/doc/log_stats.plot index 7d9dafd7..531e8a86 100644 --- a/doc/log_stats.plot +++ b/doc/log_stats.plot @@ -31,8 +31,13 @@ gnuplot << EOF # # Choke groups: # -# file.append = (cat,/foo/choke_group_stats.,(system.pid)),"timestamp","\"leech unchoked\"","\"leech queued\"","\"seed unchoked\"","\"seed queued\"" -# schedule = log_choke_group_stats,5,10,((file.append,((cat,/foo/choke_group_stats.,((system.pid)))),((system.time_seconds)),((choke_group.up.unchoked,0)),((choke_group.up.queued,0)),((choke_group.up.total,0)),((choke_group.up.unchoked,1)),((choke_group.up.queued,1)),((choke_group.up.total,1)))) +# file.append = (cat,/foo/choke_group_stats.,(system.pid)),"timestamp", +# "\"leech up unchoked\"","\"leech up queued\"","\"leech up rate\"","\"leech down unchoked\"","\"leech down queued\"","\"leech down rate\"","\"leech torrents\"", +# "\"seed up unchoked\"","\"seed up queued\"","\"seed up rate\"","\"seed down unchoked\"","\"seed down queued\"","\"seed down rate\"","\"seed torrents\"" +# +# schedule = log_choke_group_stats,5,10,((file.append,((cat,/foo/choke_group_stats.,((system.pid)))),((system.time_seconds)), +# ((choke_group.up.unchoked,0)),((choke_group.up.queued,0)),((choke_group.up.rate,0)),((choke_group.down.unchoked,0)),((choke_group.down.queued,0)),((choke_group.down.rate,0)),((choke_group.size,0)), +# ((choke_group.up.unchoked,1)),((choke_group.up.queued,1)),((choke_group.up.rate,1)),((choke_group.down.unchoked,1)),((choke_group.down.queued,1)),((choke_group.down.rate,1)),((choke_group.size,1)))) # # Mincore stats: # @@ -53,7 +58,7 @@ set output "output_$1_sockets.png" plot "peer_stats.$1" using 1:7 smooth bezier with lines lw 4,\ "peer_stats.$1" using 1:5 smooth bezier with lines lw 4,\ "peer_stats.$1" using 1:6 smooth bezier with lines lw 4,\ - "as_dict_key().c_str(), itr->as_dict_obj(), target))) return (int64_t)false; + } else if (itr->is_value()) { + if (!itr->as_value()) + return (int64_t)false; + } else { + // TODO: Switch to new versions that only accept the new command syntax. if (!as_boolean(rpc::parse_command_single(target, itr->as_string()))) return (int64_t)false; } @@ -232,6 +237,10 @@ apply_or(rpc::target_type target, const torrent::Object& rawArgs) { if (as_boolean(rpc::commands.call_command(itr->as_dict_key().c_str(), itr->as_dict_obj(), target))) return (int64_t)true; + } else if (itr->is_value()) { + if (itr->as_value()) + return (int64_t)true; + } else { if (as_boolean(rpc::parse_command_single(target, itr->as_string()))) return (int64_t)true;