Branch Coverage

File:blib/lib/Class/Shared/Backend.pm
Coverage:88.7%

line%coveragebranch
169100TFlength($opt{'token'} // '') ? :
174100TFif ($tcp) { }
175100TFunless defined $host and defined $port
178100TFif defined $socket
184100TFunless $has_token
191100TFunless $tls_set == @TLS_FILES
204100TFdefined $socket ? :
210100TFif $has_token
213100TFif $tls_set
275100TF$has_token ? :
349100TF%site ? :
372100TFunless ($valid)
39250TFif $self->{'cleaned'}
394100TFif $self->{'daemonize'}
397100TFunless ($started)
406100TFunless $self->{'daemonize'}
412100TF$self->{'token'} ? :
100TFdefined $self->{'host'} ? :
427100TFif $self->{'cleaned'}
43150TFif defined $self->{'owner_pid'} and $self->{'owner_pid'} != $$
439100TFif ($self->{'owns_socket'} and -e $self->{'socket'})
441100TFunless unlink $self->{'socket'}
454100TFif $self->{'classes'}{$class}
460100TFunless eval {         do {         require $file; 1 } }
46350TFif ($class->can("import"))
464100TFunless eval {         do {         $class->import; 1 } }
481100TFunless $dir_ok
485100TFunless sysopen $lock, $lock_path, 66, 384
492100TFif flock $lock, 6
493100TFif (time >= $deadline)
500100TFif (defined $self->{'socket'}) { }
50850TFunless fcntl $self->{'listener'}, 2, 1
51650TFunless open $pid_fh, ">", $pid_path and print {$pid_fh;} "${$}\n" and close $pid_fh
526100TFif (-e $self->{'socket'})
530100TFunless -S $self->{'socket'}
533100TFif ($probe)
538100TFunless unlink $self->{'socket'}
553100TFunless $listener
56250TFunless chmod 0600, $self->{'socket'}
571100TFunless defined $self->{'host'} and defined $self->{'port'}
593100TFunless ($context)
597100TFunless length $why
611100TFunless my $listener = "IO::Socket::INET"->new("LocalAddr", $self->{'host'}, "LocalPort", $self->{'port'}, "Proto", "tcp", "Listen", $LISTEN_BACKLOG, "ReuseAddr", 1)
640100TFunless defined $fd
644100TFif ($client->{'handshaking'}) { }
100TFelsif (length $client->{'outbuf'}) { }
64950TFif $client->{'want_write'}
655100TFif (defined $client->{'stalled_since'})
65750TFif not defined $write_deadline or $deadline < $write_deadline
666100TF$handshaking ? :
670100TFunless defined $deadline
671100TFif not defined $read_deadline or $deadline < $read_deadline
674100TFif (defined $read_deadline)
67650TFif $wait < 0
677100TFif not defined $timeout or $wait < $timeout
679100TFif (defined $write_deadline)
68150TFif $wait < 0
68250TFif not defined $timeout or $wait < $timeout
68850TFif (defined $self->{'accept_after'})
6900TFif ($wait > 0) { }
6920TFif not defined $timeout or $wait < $timeout
700100TFif $handshaking
701100TFif defined $write_deadline
70250TFdefined $ready && $ready > 0 ? :
100TFif defined $read_deadline
705100TFif not defined $ready or $ready <= 0
707100TFif (vec $rout, fileno $self->{'listener'}, 1)
71350TFunless $client
716100TFunless defined $fd
721100TFif ($client->{'handshaking'}) { }
72250TFunless $readable or $client->{'want_write'} and $writable
725100TFunless $readable or $writable
72750TFif $readable
728100TFif $writable and not $client->{'closed'}
731100TFif $self->{'stop'}
746100TFunless $client->{'handshaking'}
747100TFif $client->{'deadline'} > $now
767100TFunless (length $client->{'buffer'})
776100TFif $completed
78550TFif $total <= $self->{'max_buffered_total'}
804100TFif $client->{'handshaking'}
809100TFdefined $client->{'partial_progress'} ? :
814100TFif (not $client->{'greeted'} and defined $client->{'greet_by'})
81550TFif @partial and $partial[0] < $client->{'greet_by'}
819100TFif @partial
8250TFif $self->{'idle_timeout'} and defined $client->{'last_request'} and not length $client->{'outbuf'}
84550TFif $client->{'closed'}
847100TFunless defined $deadline
848100TFif $deadline > $now
84950TFif length $readable and vec $readable, fileno $client->{'fh'}, 1
87150TFunless $limit and defined $self->{'log'}
874100TFunless lstat $path and -f _ and -s _ > $limit
88150TFunless open my $log, "+<", $path
88450TFunless @named and -f _ and $named[0] == $opened[0] and $named[1] == $opened[1]
89050TFif (sysopen my $to, $old, 193, 384)
89250TFunless syswrite $to, $chunk
912100TFif $client->{'closed'}
913100TFunless length $client->{'outbuf'}
914100TFunless defined $client->{'stalled_since'}
915100TFif $client->{'stalled_since'} + $self->{'write_timeout'} > $now
928100TFunless ($fh)
92950TFif ($!{'EMFILE'} or $!{'ENFILE'} or $!{'ENOBUFS'} or $!{'ENOMEM'})
9320TFunless $self->{'accept_failing'}++
939100TFif (keys %{$$self{"clients"};} >= $self->{'max_clients'})
943100TFunless (defined $self->{'host'})
94850TFif defined $bytes
959100TFunless (fcntl $fh, 2, 1 and defined $fh->blocking(0))
976100TFif (defined $self->{'host'})
979100TFunless ($ssl)
1020100TFif ($fh->accept_SSL)
1038100TFif (defined $error and $error == IO::Socket::SSL::SSL_WANT_READ())
1043100TFif (defined $error and $error == IO::Socket::SSL::SSL_WANT_WRITE())
1062100TFunless defined $direction
1064100TFif $!{'EAGAIN'} or $!{'EWOULDBLOCK'}
1067100TFif $fh->can($want) and $fh->$want
1070100TFif $direction eq "write" and $fh->can("want_read") and $fh->want_read
1087100TFunless (defined $read)
1091100TFif $self->_would_block($client->{'fh'})
1097100TFif ($read == 0)
1113100TFif ($status == 0)
1117100TFif $status > 0
1119100TFif ($status < 0)
1126100TFif ($@)
1133100TFif defined $response
1135100TFif $client->{'closed'}
1136100TFif $self->{'stop'}
114450TFif not $client->{'closed'} || $client->{'greeted'} and defined $client->{'greet_by'} and $client->{'greet_by'} <= &Time::HiRes::time()
1146100TFif $completed
1147100TFunless $client->{'closed'}
1167100TFif length $body <= $THAW_UNCHECKED
117450TFunless (defined $pid)
117950TFunless ($pid)
11860TFif (open my $filter, ">", "/proc/self/coredump_filter")
1199100TF$? == 0 ? :
1207100TFif $client->{'closed'}
1209100TFdefined $reason && length $reason ? :
1214100TFif $self->{'queued'} < 0
123150TFif defined $fd
1239100TFif $client->{'closed'}
1243100TFunless (defined $bytes)
1252100TFunless (defined $bytes)
1264100TFif ($queued > $self->{'max_queued'})
1272100TFif ($self->{'queued'} + $length > $self->{'max_queued_total'})
1285100TFunless length $client->{'outbuf'}
1301100TFif $client->{'closed'} or not length $client->{'outbuf'}
1308100TFunless (defined $written)
1309100TFif ($self->_would_block($client->{'fh'}, "write"))
1322100TFif ($written == 0)
1333100TFlength $client->{'outbuf'} ? :
1336100TFunless (length $client->{'outbuf'})
1362100TFif (ref $message ne "HASH")
1366100TFdefined $message->{'op'} ? :
1368100TFif ($op eq "hello")
1372100TFunless ($client->{'greeted'})
1376100TFif $op eq "new"
1377100TFif $op eq "call"
1378100TFif $op eq "ping"
1379100TFif $op eq "shutdown"
1391100TFif $client->{'greeted'}
1397100TFdefined $message->{'proto'} && !ref($message->{'proto'}) ? :
1399100TFif ($proto ne $Class::Shared::PROTOCOL_VERSION)
1411100TFif (defined $wanted and length $wanted)
1413100TFunless ($valid)
1420100TFunless $loaded
1441100TFunless defined $class
1444100TFunless defined $args
1446100TFunless ref $args eq "ARRAY"
1450100TFif ($held >= $self->{'max_objects'})
145650TFif $timed_out
1457100TFunless $built
1459100TFunless ref $object
1477100TFunless defined $class
1480100TFunless defined $id and $id =~ /\A\d+\z/a
1484100TFunless $entry
1489100TFunless $entry->{'owner'} == $client->{'serial'}
1494100TFunless defined $method and length $method
1498100TFunless defined $args
1499100TFunless ref $args eq "ARRAY"
1503100TFunless defined $want
1504100TFunless $want =~ /\A(?:list|scalar|void)\z/
1511100TFunless $method =~ /\A[A-Za-z_][A-Za-z0-9_]*\z/
1514100TFif ($method eq "new" or $method eq "DESTROY" or $method eq "AUTOLOAD")
1520100TFif ($method eq "can" or $method eq "isa")
1525100TFunless defined $name
1527100TF$object->$method($name) ? :
152850TFif $@
153350TF&Scalar::Util::blessed($object) ? :
1534100TFunless ($target->can($method) or $target->can("AUTOLOAD"))
1540100TFif ($want eq 'list') { }
100TFelsif ($want eq 'void') { }
155150TFif $call_timed_out
1552100TFunless $ok
1583100TFif $limit
1587100TFif $limit
1590100TFif $limit
1594100TFif $timed_out
1596100TF$ok ? :
1647100TFif $self->{'cleaned'}
1650100TFif ($self->{'listener'})
1655100TFif $self->{'owns_socket'}
1660100TFunless $client->{'closed'}
1661100TFunless $client->{'closed'}
1670100TFif ($self->{'lock'})
1672100TFunless flock $self->{'lock'}, 8
168550TFunless defined $pid
1687100TFif ($pid)
169650TFunless POSIX::setsid()
170050TFif not defined $second or $second > 0
170550TFunless $detached
1721100TFif close $fh
1736100TFif unlink $path or $!{'ENOENT'}
1754100TFunless defined $level
1763100TFif defined $message
1769100TFif (not defined $self->{'logger'} or $self->{'logger_pid'} != $$)
1789100TFunless defined $self->{'logger'}
1793100TFeval {         do {         $self->{'logger'}->$level($message); 1 } } ? :