Skip to content

Commit

Permalink
improved performance of all built in servers significantly
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Oct 11, 2011
1 parent 631e057 commit 5714998
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions lib/Mojo/Server/Daemon.pm
Expand Up @@ -319,13 +319,12 @@ sub _write {

# Write
weaken $self;
my $done = $tx->is_done;
$self->ioloop->write(
$id => $chunk => sub {
$self->_finish($id, $tx) if $done;
$self->_write($id);
}
);
my $cb = sub { $self->_write($id) };
if ($tx->is_done) {
$self->_finish($id, $tx);
$cb = undef unless $c->{transaction} || $c->{websocket};
}
$self->ioloop->write($id, $chunk, $cb);
warn "> $chunk\n" if DEBUG;
}

Expand Down

0 comments on commit 5714998

Please sign in to comment.