From 3693adb343ef70a3fc6f4f817989c6c113b0c4f4 Mon Sep 17 00:00:00 2001 From: Younes Ichiche Date: Sun, 5 Apr 2020 14:04:41 +0200 Subject: [PATCH] fix multicall arg --- plugins/rtorrent/rtom_allsessions_peers | 3 ++- plugins/rtorrent/rtom_peers | 3 ++- plugins/rtorrent/rtom_vol | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/rtorrent/rtom_allsessions_peers b/plugins/rtorrent/rtom_allsessions_peers index bf26167a..5526668c 100755 --- a/plugins/rtorrent/rtom_allsessions_peers +++ b/plugins/rtorrent/rtom_allsessions_peers @@ -125,8 +125,9 @@ my $pattern = qr/<(int|i4|i8|ex\.i8)>(\d+)<\/(int|i4|i8|ex\.i8)><\/value my $tpattern = qr/[0-9A-F]{20}/; sub construct_line { my $function_multicall = rtorrent_version_lower_than($_[0], '0.9.0') ? 'd.multicall' : 'd.multicall2'; + my $function_multicall_arg = rtorrent_version_lower_than($_[0], '0.9.0') ? '' : ''; my $function_hash = rtorrent_version_lower_than($_[0], '0.9.0') ? 'd.get_hash=' : 'd.hash='; - my $line = "$function_multicallmain$function_hashp.multicall=,p.is_encrypted=,p.is_incoming="; + my $line = "$function_multicall$function_multicall_argmain$function_hashp.multicall=,p.is_encrypted=,p.is_incoming="; my $llen = length $line; my $header = "CONTENT_LENGTH\000${llen}\000SCGI\001\000"; my $hlen = length $header; diff --git a/plugins/rtorrent/rtom_peers b/plugins/rtorrent/rtom_peers index 0fbfae9e..29b55934 100755 --- a/plugins/rtorrent/rtom_peers +++ b/plugins/rtorrent/rtom_peers @@ -109,8 +109,9 @@ my $pattern = qr/<(int|i4|i8|ex\.i8)>(\d+)<\/(int|i4|i8|ex\.i8)><\/value> my $tpattern = qr/[0-9A-F]{20}/; my $function_multicall = rtorrent_version_lower_than('0.9.0') ? 'd.multicall' : 'd.multicall2'; +my $function_multicall_arg = rtorrent_version_lower_than('0.9.0') ? '' : ''; my $function_hash = rtorrent_version_lower_than('0.9.0') ? 'd.get_hash=' : 'd.hash='; -my $line = "$function_multicallmain$function_hashp.multicall=,p.is_encrypted=,p.is_incoming="; +my $line = "$function_multicall$function_multicall_argmain$function_hashp.multicall=,p.is_encrypted=,p.is_incoming="; my $llen = length $line; my $header = "CONTENT_LENGTH\000${llen}\000SCGI\001\000"; my $hlen = length $header; diff --git a/plugins/rtorrent/rtom_vol b/plugins/rtorrent/rtom_vol index fe842e09..59f15136 100755 --- a/plugins/rtorrent/rtom_vol +++ b/plugins/rtorrent/rtom_vol @@ -135,7 +135,7 @@ foreach ( @views ) { } $function_multicall = rtorrent_version_lower_than('0.9.0')? 'd.multicall' : 'd.multicall2'; - $function_multicall_arg = rtorrent_version_lower_than($_[0], '0.9.0') ? '' : ''; + $function_multicall_arg = rtorrent_version_lower_than('0.9.0') ? '' : ''; $function_hash = rtorrent_version_lower_than('0.9.0')? 'd.get_hash=' : 'd.hash='; $line = "$function_multicall$function_multicall_arg${_}$function_hash";