From 9534979768b91acafb1e04f1802d3de2345534aa Mon Sep 17 00:00:00 2001 From: Younes Ichiche Date: Sun, 5 Apr 2020 12:48:28 +0200 Subject: [PATCH] get the version from rtorrent out of the loop and cache it already to avoid SOCK to be overwritten --- plugins/rtorrent/rtom_allsessions_vol | 7 +++++-- plugins/rtorrent/rtom_vol | 6 +++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/plugins/rtorrent/rtom_allsessions_vol b/plugins/rtorrent/rtom_allsessions_vol index d067fde7..37b8a10e 100755 --- a/plugins/rtorrent/rtom_allsessions_vol +++ b/plugins/rtorrent/rtom_allsessions_vol @@ -104,9 +104,12 @@ sub rtorrent_version_lower_than { } close (SOCK); } - return version->parse($rtorrent_version) < version->parse($_[0]); + if(defined $_[0]){ + return version->parse($rtorrent_version) < version->parse($_[0]); + } } - +# init rtorrent_version +rtorrent_version_lower_than(); my $pattern = qr/([A-Z0-9]+)<\/string><\/value>/; diff --git a/plugins/rtorrent/rtom_vol b/plugins/rtorrent/rtom_vol index e121aa39..1ea5678f 100755 --- a/plugins/rtorrent/rtom_vol +++ b/plugins/rtorrent/rtom_vol @@ -106,8 +106,12 @@ sub rtorrent_version_lower_than { } close (SOCK); } - return version->parse($rtorrent_version) < version->parse($_[0]); + if(defined $_[0]){ + return version->parse($rtorrent_version) < version->parse($_[0]); + } } +# init rtorrent_version +rtorrent_version_lower_than(); my $pattern = qr/([A-Z0-9]+)<\/string><\/value>/;