Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
more defensive regular expressions
  • Loading branch information
kraih committed Jan 15, 2014
1 parent 1c14dda commit b16935c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Mojo/IOLoop/Server.pm
Expand Up @@ -33,7 +33,7 @@ has reactor => sub {

sub DESTROY {
my $self = shift;
$ENV{MOJO_REUSE} =~ s/(?:^|\,)$self->{reuse}:\d+// if $self->{reuse};
$ENV{MOJO_REUSE} =~ s/(?:^|\,)\Q$self->{reuse}\E:\d+// if $self->{reuse};
return unless my $reactor = $self->reactor;
$self->stop if $self->{handle};
$reactor->remove($_) for values %{$self->{handles}};
Expand All @@ -55,7 +55,7 @@ sub listen {
my $reuse = $self->{reuse} = "$address:$port";
$ENV{MOJO_REUSE} ||= '';
my $fd;
if ($ENV{MOJO_REUSE} =~ /(?:^|\,)${reuse}:(\d+)/) { $fd = $1 }
if ($ENV{MOJO_REUSE} =~ /(?:^|\,)\Q$reuse\E:(\d+)/) { $fd = $1 }

# Allow file descriptor inheritance
local $^F = 1000;
Expand Down

0 comments on commit b16935c

Please sign in to comment.