--- AnyEvent-FCP/FCP.pm 2015/08/08 14:09:47 1.14 +++ AnyEvent-FCP/FCP.pm 2015/08/14 03:33:13 1.15 @@ -109,7 +109,7 @@ @_, queue => [], req => {}, - prefix => "..:aefcpid-$rand:", + prefix => "..:aefcpid:$rand:", idseq => "a0", }, $class; @@ -396,7 +396,7 @@ } else { my $bt = Carp::longmess ""; $err = sub { - die "$_[0]{extra_description}$bt"; + die "$_[0]{code_description} ($_[0]{extra_description})$bt"; }; } @@ -551,16 +551,27 @@ _txn get_plugin_info => sub { my ($self, $ok, $err, $name, $detailed) = @_; + my $id = $self->identifier; + $self->send_msg (get_plugin_info => + identifier => $id, plugin_name => $name, detailed => $detailed ? "true" : "false", - id_cb => sub { - my ($self, $type, $kv, $rdata) = @_; - - $ok->($kv); - 1 - }, ); + $self->on (sub { + my ($self, $type, $kv) = @_; + + if ($kv->{identifier} eq $id) { + if ($type eq "get_plugin_info") { + $ok->($kv); + } else { + $err->($kv, $type); + } + return; + } + + 1 + }); }; =item $status = $fcp->client_get ($uri, $identifier, %kv)