Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
whitespace
  • Loading branch information
miyagawa committed Feb 18, 2010
1 parent f61e463 commit 2d065bd
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions lib/Twiggy/Server.pm
Expand Up @@ -326,29 +326,29 @@ sub _write_psgi_response {
my ( $self, $sock, $res ) = @_;

if ( ref $res eq 'ARRAY' ) {
if ( scalar @$res == 0 ) {
# no response
$self->{exit_guard}->end;
return;
}
if ( scalar @$res == 0 ) {
# no response
$self->{exit_guard}->end;
return;
}

my ( $status, $headers, $body ) = @$res;

my $cv = AE::cv;

$self->_write_headers( $sock, $status, $headers )->cb(sub {
local $@;
if ( eval { $_[0]->recv; 1 } ) {
$self->_write_body($sock, $body)->cb(sub {
shutdown $sock, 1;
$self->{exit_guard}->end;
local $@;
eval { $cv->send($_[0]->recv); 1 } or $cv->croak($@);
});
}
});

return $cv;
my $cv = AE::cv;

$self->_write_headers( $sock, $status, $headers )->cb(sub {
local $@;
if ( eval { $_[0]->recv; 1 } ) {
$self->_write_body($sock, $body)->cb(sub {
shutdown $sock, 1;
$self->{exit_guard}->end;
local $@;
eval { $cv->send($_[0]->recv); 1 } or $cv->croak($@);
});
}
});

return $cv;
} else {
no warnings 'uninitialized';
warn "Unknown response type: $res";
Expand Down

0 comments on commit 2d065bd

Please sign in to comment.