Skip to content

Commit

Permalink
Data::AMFの変更にあわせて使い方も変更
Browse files Browse the repository at this point in the history
  • Loading branch information
typester committed Jul 23, 2008
1 parent 1c2d37b commit 12f3d09
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/Catalyst/Controller/FlashRemoting/Action/Gateway.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use strict;
use warnings;
use base qw/Catalyst::Action/;

use Data::AMF;
use Data::AMF::Packet;

sub execute {
my $self = shift;
Expand All @@ -12,7 +12,7 @@ sub execute {
if ($c->req->content_type eq 'application/x-amf' and my $body = $c->req->body) {
my $data = do { local $/; <$body> };

my $request = Data::AMF->deserialize_packet($data);
my $request = Data::AMF::Packet->deserialize($data);

my @results;
for my $message (@{ $request->messages }) {
Expand All @@ -27,14 +27,14 @@ sub execute {
}
}

my $response = Data::AMF->serialize_packet(
my $response = Data::AMF::Packet->new(
version => $request->version,
headers => [],
messages => \@results,
);

$c->res->content_type('application/x-amf');
$c->res->body( $response );
$c->res->body( $response->serialize );
}
else {
$c->res->status(500);
Expand Down

0 comments on commit 12f3d09

Please sign in to comment.