| line |
true |
false |
branch |
|
164
|
2 |
15 |
unless defined $self->{'socket'} and length $self->{'socket'} |
|
168
|
4 |
49 |
unless $self->{$opt} =~ /^\d+$/ and $self->{$opt} > 0 |
|
172
|
2 |
19 |
unless $self->{$opt} =~ /^\d+$/ |
|
178
|
1 |
8 |
unless $self->{'idle_timeout'} =~ /^\d+$/ and $self->{'idle_timeout'} >= $self->{'window'} |
|
180
|
3 |
5 |
if (defined $args{'socket_mode'}) |
|
182
|
2 |
1 |
unless $args{'socket_mode'} =~ /^0?[0-7]{3}$/ |
|
208
|
0 |
3 |
if $self->{'running'} |
|
221
|
0 |
3 |
if $timeout < 0 |
|
225
|
1 |
2 |
unless $r |
|
226
|
1 |
1 |
if (fileno $fh == $self->{'listener_fd'}) { } |
|
233
|
1 |
2 |
unless $w |
|
237
|
0 |
0 |
unless defined $id and $self->{'conns'}{$id} |
|
241
|
0 |
3 |
if (time >= $self->{'next_sweep'}) |
|
269
|
2 |
1 |
if (-e $path) |
|
270
|
1 |
1 |
unless -S _ |
|
272
|
1 |
0 |
if $probe |
|
273
|
0 |
0 |
unless unlink $path |
|
280
|
0 |
1 |
unless my $listener = "IO::Socket::UNIX"->new("Type", 1, "Local", $path, "Listen", $self->{'listen_backlog'}) |
|
283
|
0 |
1 |
if defined $self->{'socket_mode'} |
|
294
|
0 |
1 |
if ($self->{'max_clients'} and keys %{$$self{"conns"};} >= $self->{'max_clients'}) |
|
317
|
0 |
1 |
unless my $c = $self->{'conns'}{$id} |
|
323
|
0 |
1 |
unless (defined $n) |
|
324
|
0 |
0 |
if $!{'EAGAIN'} or $!{'EWOULDBLOCK'} or $!{'EINTR'} |
|
328
|
0 |
1 |
if ($n == 0) |
|
330
|
1 |
0 |
if $n < 65536 |
|
333
|
0 |
1 |
if (length $c->{'rbuf'} > 1048576) |
|
339
|
0 |
0 |
if $eof and $self->{'conns'}{$id} |
|
357
|
0 |
1 |
unless defined $cmd |
|
359
|
0 |
1 |
if defined $extra |
|
364
|
0 |
1 |
if ($cmd eq "MARK") |
|
366
|
0 |
0 |
if (defined $extra) |
|
367
|
0 |
0 |
if ($extra =~ /^\d{1,15}$/ and $extra > 0) { } |
|
374
|
0 |
0 |
unless (defined $key and $key =~ /$self->{'key_re'}/) |
|
378
|
0 |
0 |
unless (exists $self->{'meters'}{$key} or exists $pending{$key}) |
|
379
|
0 |
0 |
if ($self->{'max_keys'} and keys(%{$$self{"meters"};}) + $pending_new >= $self->{'max_keys'}) |
|
391
|
0 |
1 |
if (%pending) |
|
397
|
0 |
1 |
if $c->{'closing'} |
|
400
|
0 |
1 |
if %pending |
|
401
|
1 |
0 |
$pos ? : |
|
425
|
0 |
1 |
if ($cmd eq "RATE" or $cmd eq "COUNT" or $cmd eq "TOTAL") |
|
427
|
0 |
0 |
unless defined $key and $key =~ /$self->{'key_re'}/ |
|
433
|
0 |
0 |
$cmd eq 'COUNT' ? : |
|
|
0 |
0 |
$cmd eq 'RATE' ? : |
|
|
0 |
0 |
!$e ? : |
|
437
|
0 |
1 |
if ($cmd eq "MARKRATE") |
|
439
|
0 |
0 |
if (defined $extra) |
|
440
|
0 |
0 |
unless $extra =~ /^\d{1,15}$/ and $extra > 0 |
|
445
|
0 |
0 |
unless defined $key and $key =~ /$self->{'key_re'}/ |
|
446
|
0 |
0 |
if (not exists $meters->{$key} and $self->{'max_keys'} and keys %$meters >= $self->{'max_keys'}) |
|
456
|
0 |
1 |
if ($cmd eq "STATS") |
|
457
|
0 |
0 |
if (defined $key) |
|
459
|
0 |
0 |
unless $key =~ /$self->{'key_re'}/ |
|
464
|
0 |
0 |
$e ? : |
|
478
|
0 |
1 |
if ($cmd eq "KEYS") |
|
485
|
0 |
1 |
if ($cmd eq "DUMP") |
|
495
|
0 |
1 |
if ($cmd eq "RESET") |
|
497
|
0 |
0 |
unless defined $key and $key =~ /$self->{'key_re'}/ |
|
498
|
0 |
0 |
if (my $e = $meters->{$key}) |
|
505
|
0 |
1 |
if ($cmd eq "DEL") |
|
507
|
0 |
0 |
unless defined $key and $key =~ /$self->{'key_re'}/ |
|
512
|
1 |
0 |
if ($cmd eq "PING") |
|
516
|
0 |
0 |
if ($cmd eq "QUIT") |
|
528
|
1 |
0 |
if ($c->{'wbuf'} eq "") |
|
530
|
1 |
0 |
if (defined $n) { } |
|
|
0 |
0 |
elsif (not $!{'EAGAIN'} || $!{'EWOULDBLOCK'} || $!{'EINTR'}) { } |
|
531
|
1 |
0 |
if ($n == length $data) |
|
532
|
0 |
1 |
if $c->{'closing'} |
|
542
|
0 |
0 |
if length $c->{'wbuf'} > 8388608 |
|
551
|
0 |
0 |
unless (defined $n) |
|
552
|
0 |
0 |
if $!{'EAGAIN'} or $!{'EWOULDBLOCK'} or $!{'EINTR'} |
|
556
|
0 |
0 |
if ($c->{'wbuf'} eq "") |
|
558
|
0 |
0 |
if $c->{'closing'} |
|
584
|
1 |
0 |
if ($self->{'listener'}) |