Skip to content

Commit

Permalink
Debug all received lines and avoid pushing FIN lines onto the results
Browse files Browse the repository at this point in the history
  • Loading branch information
tsibley committed Mar 7, 2013
1 parent e51000f commit eed3a99
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Soundbridge.pm
Expand Up @@ -72,12 +72,12 @@ sub rcp ($$;$) {
while ($_ = $self->socket->getline) {
s/^\Q$pre\E:\s*//;
s/[\r\n]//g;
$code->($_) if $code;
push @result, $_
if not /^ListResult/ and /\S/;
$self->debug("<-- $_");
$code->($_) if $code;
warn "$cmd: $_\n" if /Error|Failed|UnknownCommand/ and $self->log_level;
last if /(?:^ListResultEnd|^OK|^TransactionComplete|Error|Failed|UnknownCommand)/;
push @result, $_
if not /^ListResult/ and /\S/;
}
return wantarray ? @result : \@result;
}
Expand Down

0 comments on commit eed3a99

Please sign in to comment.