Skip to content

Commit

Permalink
do not capture the connection
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jan 9, 2016
1 parent ee0f220 commit aa7c750
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/Mojo/Server/Daemon.pm
Expand Up @@ -174,16 +174,20 @@ sub _listen {
$options => sub {
my ($loop, $stream, $id) = @_;

my $c = $self->{connections}{$id} = {tls => $tls};
$self->{connections}{$id} = {tls => $tls};
warn "-- Accept $id (@{[$stream->handle->peerhost]})\n" if DEBUG;
$stream->timeout($self->inactivity_timeout);

$stream->on(close => sub { $self && $self->_close($id) });
$stream->on(error =>
sub { $self && $self->app->log->error(pop) && $self->_close($id) });
$stream->on(read => sub { $self->_read($id => pop) });
$stream->on(timeout =>
sub { $self->app->log->debug('Inactivity timeout') if $c->{tx} });
$stream->on(
timeout => sub {
$self->app->log->debug('Inactivity timeout')
if $self->{connections}{$id}{tx};
}
);
}
);

Expand Down

0 comments on commit aa7c750

Please sign in to comment.