Skip Menu |

This queue is for tickets about the Net-uTorrent CPAN distribution.

Report information
The Basics
Id: 54459
Status: open
Priority: 0/
Queue: Net-uTorrent

People
Owner: Nobody in particular
Requestors: bitcard [...] citopia.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.02
Fixed in: (no value)



Subject: Patch for utorrent 2.0
When using uTorrent 2.0 on Windows (released 2/6/10), the query string needs to go in a slightly different order, as detailed here: http://forum.utorrent.com/viewtopic.php?pid=451624 This ugly patch seems to fix the problem: sub api_query_result { my (@params) = @_; my $api = URI->new($api_url); for my $array_value (@params) { for my $key (keys %$array_value) { $api->query_param_append($key => $$array_value{$key}); } } my $str = $api; $str =~ s/(gui\/\?)/$1token=$token&/; return $ua->get($str)->decoded_content; } Thanks again for the original module, it is awesome. -d
From: ptsampoukas [...] gmail.com
There is indeed a problem with uTorrent 2.0. The token argument has to be first in order. For example, this works always: wget "http://user:pass@192.168.1.10:8081/gui/?token=$token&action=stop&hash=$hash" -O lala.html But the lib sends the arguments in this order: wget "http://user:pass@192.168.1.10:8081/gui/?action=stop&hash=$hash&token=$token" -O lala.html And the result is: HTTP/1.1 400 ERROR Now, the whole point of this post is to suggest the more pretty fix (and not my sillyness for fixing the bug before checking if a bug was raised :P). You can fix this by simply rearranging a line: lib/Net# diff uTorrent.pm{.original,.fixed} 345a346 Show quoted text
> $api->query_param(token => $token);
352d352 < $api->query_param(token => $token);
From: ptsampoukas [...] gmail.com
On Sun Jan 16 16:03:02 2011, ptsampoukas wrote: Show quoted text
> lib/Net# diff uTorrent.pm{.original,.fixed} > 345a346
> > $api->query_param(token => $token);
> 352d352 > < $api->query_param(token => $token);
The change above would solve the GET requests, but the POST requests (torrent file upload) would remain broken. The following change fixes the file upload: 318a319 Show quoted text
> $api->query_param(token => $token);
320d320 < $api->query_param(t => $token); Now, I fully realize that the HTTP standard does not set any guarantees on the order of the arguments so this could be considered a bug of uTorrent. But if you consider that the whole GET URL is created on the server side, we can justify uTorrent to be picky.