1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-08-08 15:13:30 +00:00

rtorrent: fix SCGI headers

Newer versions of rtorrent stopped responding to these plugins, and
comparing it to another (working) XML-RPC client, the difference was the
1 after the SCGI in the header (\000 1 vs \001).

This matches up with the example on Wikipedia's "Simple Common Gateway
Interface" page.
This commit is contained in:
Matt Merhar 2025-07-21 22:19:27 -04:00
parent cceb4a7db7
commit 7106ecaec0
8 changed files with 16 additions and 16 deletions

View file

@ -70,7 +70,7 @@ sub get_rtorrent_version {
my $version;
my $line_version= "<?xml version=\"1.0\" encoding=\"utf-8\"?><methodCall><methodName>system.client_version</methodName></methodCall>";
my $llen = length $line_version;
my $header = "CONTENT_LENGTH\000${llen}\000SCGI\001\000";
my $header = "CONTENT_LENGTH\000${llen}\000SCGI\0001\000";
my $hlen = length $header;
$line_version= "${hlen}:${header},${line_version}";
print SOCK $line_version;
@ -117,7 +117,7 @@ sub construct_line {
my $function = rtorrent_version_lower_than($_[0], '0.9.0') ? 'get_memory_usage' : 'pieces.memory.current';
my $line = "<?xml version=\"1.0\" encoding=\"utf-8\"?><methodCall><methodName>$function</methodName></methodCall>";
my $llen = length $line;
my $header = "CONTENT_LENGTH\000${llen}\000SCGI\001\000";
my $header = "CONTENT_LENGTH\000${llen}\000SCGI\0001\000";
my $hlen = length $header;
$line = "${hlen}:${header},${line}";
return $line;