Bug 2535 - <playerid> playlist genre/path ? commands do not work and can kill the telnet connect
: <playerid> playlist genre/path ? commands do not work and can kill the telnet...
Status: RESOLVED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: CLI
: 6.2.0
: PC Debian Linux
: P2 normal (vote)
: ---
Assigned To: Fred
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-11-11 06:34 UTC by Justus Pendleton
Modified: 2008-09-15 14:37 UTC (History)
1 user (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Justus Pendleton 2005-11-11 06:34:15 UTC
If I telnet to 9090 and issue the command
<playerid> playlist path 1 ?
the slimserver does not return the path of the first playlist item.  If I try
<playerid> playlist genre 1 ?
I get page and page of binary garbage.  The other playlist index query commands result in similarly bad behavior, sometimes killing the telnet connection and causing the squeezebox to lose connectivity to the slimserver.

Some debugging turns up that these queries result in execute in Command.pm doing a database query.  $p3 gets filled in with some database hash reference thing.  Later on during the CLI processing cycle Encode::encode is called upon this hash.  I not a perl guru but I don't think this is expecting anything but a string.  It appears that the Encode::encode is doing bad things.

I changed my local copy of slimserver to look like the following around lines 966-968 of Slim/Control/Command.pm:

} elseif ($p1 eq "path") {
    $p3 = Slim::Player::Playlist::Song($client,$p2) || 0;
    if ($p3) { $p3 = $p3->url() }

And now it works as expected.

A quick check shows that the same problem exists in the current SVN trunk.
Comment 1 KDF 2005-11-11 09:43:50 UTC
Fred, do you want to handle this one?
Comment 2 Blackketter Dean 2005-11-11 15:56:10 UTC
I wonder if it's enough to force stringification on all the results in the array or  if we'll need to check for references in each command...  Dan?


Comment 3 Dan Sully 2005-11-11 16:46:12 UTC
Justus - can you try the 6.2.1 nightly builds, and post a crash log if this is still an issue?

Thanks.
Comment 4 Justus Pendleton 2005-11-11 17:56:25 UTC
I downloaded the SlimServer_6_2_x_v2005-11-11 tarball; it appears to be working as expected.  Thanks.