Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Transmission-Client CPAN distribution.

Report information
The Basics
Id: 67691
Status: resolved
Priority: 0/
Queue: Transmission-Client

People
Owner: Nobody in particular
Requestors: antonuk84 [...] yandex.ru
Cc:
AdminCc:

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



Subject: ids as hashes
Date: Fri, 22 Apr 2011 13:48:23 +0400
To: bug-transmission-client [...] rt.cpan.org
From: Ukolov Anton <antonuk84 [...] yandex.ru>
Hi, Jan! Thanks for you work, Transmission::Client is pretty well module. We use it to work with transmission. Rpc-spec of transmission allows to use hash_strings as ids: https://trac.transmissionbt.com/browser/trunk/extras/rpc-spec.txt#L76 But in your code in Transmission::Client (at lines 541-543): # make sure ids are numeric if(ref $args{'ids'} eq 'ARRAY') { $_ += 0 for(@{ $args{'ids'} }); } you translate all hash_strings in array_ref to numbers. And hashes (such as '529f5fd6564932a32ae11bede156c2b8c0a113ea') will be zeros. It overlaps awesome feature of transmission. That is reason to do it? Is it bug or feature of your module? Thanks. With best reagrds, Anton Ukolov
Subject: Re: [rt.cpan.org #67691] ids as hashes
Date: Fri, 22 Apr 2011 23:44:59 +0200
To: bug-Transmission-Client [...] rt.cpan.org
From: Jan Henning Thorsen <jhthorsen [...] cpan.org>
The reason is that the input list of ids might be objects, so I'm forcing the overload json object to convert a "javascript" integer into a "real" perl integer. I think a valid fix for this would be: for my $i (@{ $args{id'} }) { $i += 0 if(blessed $i); } Will upload the patch as soon as possible. On Fri, Apr 22, 2011 at 11:48 AM, Ukolov Anton via RT < bug-Transmission-Client@rt.cpan.org> wrote: Show quoted text
> Fri Apr 22 05:48:36 2011: Request 67691 was acted upon. > Transaction: Ticket created by antonuk84@yandex.ru > Queue: Transmission-Client > Subject: ids as hashes > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: antonuk84@yandex.ru > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=67691 > > > > Hi, Jan! > > Thanks for you work, Transmission::Client is pretty well module. > > We use it to work with transmission. Rpc-spec of transmission allows to > use hash_strings as ids: > https://trac.transmissionbt.com/browser/trunk/extras/rpc-spec.txt#L76 > > But in your code in Transmission::Client (at lines 541-543): > # make sure ids are numeric > if(ref $args{'ids'} eq 'ARRAY') { > $_ += 0 for(@{ $args{'ids'} }); > } > you translate all hash_strings in array_ref to numbers. And hashes (such > as '529f5fd6564932a32ae11bede156c2b8c0a113ea') will be zeros. > It overlaps awesome feature of transmission. > That is reason to do it? > > Is it bug or feature of your module? > > Thanks. > > With best reagrds, > Anton Ukolov > >
Fixed and pushed to github/cpan: +0.0602 Fri Apr 29 22:18:36 CEST 2011 + - Fix RT#67691: rpc() can now handle ids as hashes + for my $id (@{ $args{'ids'} }) { + # Need to convert string integer to "real" integer + # FLAGS = (IOK,POK,pIOK,pPOK) + # IV = 42 + # ...to... + # FLAGS = (PADTMP,IOK,pIOK) + # IV = 42 + $id += 0 if($id =~ /^\d+$/);