Branch Coverage

blib/lib/Net/Server/Proto.pm
Criterion Covered Total %
branch 57 140 40.7


line true false branch
31 9 91 if (ref $port eq 'HASH') { }
32 0 9 unless $port->{'port'}
36 1 90 if $port =~ s( (?<=[\w*\]]) [,|\s:/]+ (sock_stream|sock_dgram) \b )[]x
38 7 84 if $port =~ s( (?<=[\w*\]]) [,|\s:/]+ IPv([*\d]+) )[]xi
39 0 91 if $port =~ s( (?<=[\w*\]]) [,|\s:/]+ IPv([*\d]+) )[]xi
40 23 68 if $port =~ s( (?<=[\w*\]]) [,|\s:/]+ (tcp|udp|ssl|ssleay|unix|unixdgram|\w+(?: ::\w+)+) $ )[]xi or $port =~ s[ / (\w+) $ ][]x
42 21 70 if $port =~ s/ ^ (.*?) [,|\s:]+ (?= \w+ $) //x
48 41 58 defined $host && length $host ? :
49 0 100 if $info->{'host'} =~ s( (?<=[\w*\]]) [,|\s:/]+ IPv([*\d]+) )[]xi
50 0 100 if $info->{'host'} =~ s( (?<=[\w*\]]) [,|\s:/]+ IPv([*\d]+) )[]xi
51 1 99 if ($info->{'host'} =~ m(^ \[ ([\w/.\-:]+ | \*?) \] $ )x) { }
99 0 elsif ($info->{'host'} =~ m[^ ([\w/.\-:]+ | \*?) $ ]x) { }
52 1 0 length $1 ? :
61 0 100 if $info->{'proto'} =~ s( (?<=[\w*\]]) [,|\s:/]+ IPv([*\d]+) )[]xi
62 0 100 if $info->{'proto'} =~ s( (?<=[\w*\]]) [,|\s:/]+ IPv([*\d]+) )[]xi
63 100 0 if ($info->{'proto'} =~ /^(\w+ (?:::\w+)*)$/x) { }
70 8 92 if ($info->{'proto'} =~ /^UNIX/i)
74 0 92 if ref $ipv eq "ARRAY"
75 0 92 if $ipv and not $ipv =~ /[46*]/
77 41 51 if (not $ipv or $ipv =~ /[*]/) { }
0 51 elsif ($ipv =~ /6/ or $info->{'host'} =~ /:/) { }
79 0 41 unless @rows
82 0 41 $warn ? :
83 0 41 if $ipv ne 4 and $proto ne "ssl"
85 0 41 if (@rows > 1 and $rows[0][1] == 0)
93 40 1 if $_info->{'host'} ne $info->{'host'} or $_info->{'port'} ne $info->{'port'}
94 0 41 if $_info->{'warn'}
98 0 0 if $proto ne "ssl"
99 0 0 if $ipv =~ /4/ and not $info->{'host'} =~ /:/
109 0 81 unless defined $host
110 40 41 unless defined $port
111 40 41 unless defined $proto
112 0 81 if $proto =~ /UNIX/i
113 0 81 if $port =~ /\D/
116 1 80 if ($host =~ /^\d+(?:\.\d+){3}$/) { }
0 80 elsif (not $ENV{'NO_IPV6'} and eval { do { require Socket6 } } and eval { do { require IO::Socket::IP } } || eval { do { require IO::Socket::INET6 } }) { }
0 80 elsif ($host =~ /:/) { }
117 0 1 unless my $addr = Socket::inet_aton($host)
120 0 0 lc $proto eq 'udp' ? :
121 0 0 lc $proto eq 'udp' ? :
122 0 0 $host eq '*' ? :
123 0 0 if @res < 5
127 0 0 if @res2 < 2
129 0 0 $afam == 2 ? :
0 0 $afam == Socket6::AF_INET6() ? :
132 0 0 $_->[0] =~ /^::ffff:(\d+(?:\.\d+){3})$/ ? :
0 0 $_->[0] eq '::' ? :
133 0 0 if (scalar keys %ipv6mapped and grep {$ipv6mapped{$_->[0]};} @info and not my $only = $class->_bindv6only)
138 0 0 if ($host eq '*' and $i6->[0] eq '::' and not length $only and not eval { do { die $! unless 'IO::Socket::INET6'->new->configure({'LocalAddr', '', 'LocalPort', 0, 'Listen', 1, 'ReuseAddr', 1, 'Domain', Socket6::AF_INET6()}) } }) { }
139 0 0 unless "IO::Socket::INET6"->new->configure({"LocalAddr", "", "LocalPort", 0, "Listen", 1, "ReuseAddr", 1, "Domain", Socket6::AF_INET6()})
143 0 0 length $only ? :
153 40 40 if ($host eq '*') { }
157 0 40 unless @addr
168 0 0 unless length $val
175 0 0 if (-e $file) { }
0 0 elsif (-x '/sbin/sysctl') { }
176 0 0 unless open my $fh, "<", $file
182 0 0 defined $val ? :
190 99 1 unless ($proto_class =~ /::/)
191 0 99 unless $proto_class =~ /^\w+$/
195 0 100 unless eval { do { require $file } }
199 0 107 $requires_ipv6 ? :
203 0 0 if $ipv6_package
205 0 0 unless eval { do { require Socket6 } }
209 0 0 if ($pkg) { }
0 0 elsif ($INC{'IO/Socket/IP.pm'}) { }
0 0 elsif ($INC{'IO/Socket/INET6.pm'}) { }
0 0 elsif (eval { do { require IO::Socket::IP } }) { }
211 0 0 unless eval { do { require $file } }
220 0 0 if (eval { do { require IO::Socket::INET6 } }) { }