Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
no need to assign multi_accept more than once
  • Loading branch information
kraih committed Feb 17, 2015
1 parent 6d2ef7a commit 7cf093a
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions lib/Mojo/IOLoop.pm
Expand Up @@ -37,7 +37,7 @@ sub acceptor {

# Connect acceptor with reactor
my $id = $self->_id;
$self->{acceptors}{$id} = $acceptor;
$self->{acceptors}{$id} = $acceptor->multi_accept($self->multi_accept);
weaken $acceptor->reactor($self->reactor)->{reactor};

# Allow new acceptor to get picked up
Expand Down Expand Up @@ -172,13 +172,8 @@ sub _limit {

sub _maybe_accepting {
my $self = shift;

# Check connection limit
return if $self->{accepting} || $self->_limit;

# Check if multi-accept is desirable
my $acceptors = $self->{acceptors} || {};
$_->multi_accept($self->multi_accept)->start for values %$acceptors;
$_->start for values %{$self->{acceptors} || {}};
$self->{accepting} = 1;
}

Expand Down Expand Up @@ -346,7 +341,7 @@ C<1000>.
$loop = $loop->multi_accept(100);
Number of connections to accept at once, defaults to C<50> or C<1>, depending
if the value of L</"max_connections"> is smaller than C<50>.
on if the value of L</"max_connections"> is smaller than C<50>.
=head2 reactor
Expand Down

0 comments on commit 7cf093a

Please sign in to comment.