Condition Coverage

blib/lib/IO/Socket/DNS/Server.pm
Criterion Covered Total %
condition 0 57 0.0


and 3 conditions

line !l l&&!r l&&r condition
67 0 0 0 $rr->type eq 'NS' and $$soa{lc $rr->name}
72 0 0 0 $rr->type eq 'CNAME' and $$soa{lc $rr->name}
77 0 0 0 $rr->type eq 'A' and $$soa{lc $rr->name}
140 0 0 0 $qname =~ /^([a-z]*)\.?$suffix/ and my $static = $$TXT{$1}
0 0 0 $qname =~ /^([a-z\-]+)(\d+)\.$suffix$/ and my $method = $$TXT{$1 . '0'}
0 0 0 $qname =~ /^([0-9a-w]{6})\.(\d+)\.([0-9a-w.]+)\.$suffix$/ && $2 == length $3 || $qname =~ /^([0-9a-w]{6})\.()([xz])\.$suffix$/ and my $proxy = $$self{'_proxy'}{$1}
250 0 0 0 $encoded eq 'x' and my $tcp = $$self{'_tcp'}{$sock}
896 0 0 0 $$self{'_tcp'}{$sock} and $$self{'_tcp'}{$sock}{'seqid'}

or 2 conditions

line l !l condition
54 0 0 $args{'Verbose'} ||= 0
55 0 0 $ENV{'DNS_PASSWORD'} || $args{'Password'} || ''
122 0 0 $reply_handler || sub { ReplyHandler($self, @_); }
149 0 0 eval { do { my $code = ref $method eq 'CODE' ? &$method($self, $prefix) : $self->$method($prefix); warn "DEBUG: $method string=[$code]\n" if $$self{'Verbose'}; my(@encode) = (); while ($code =~ s/^(.{1,100})//s) { my $chunk = $1; push @encode, unpack('H*', $chunk); } ; warn Dumper(['code_array', \@encode]) if $$self{'Verbose'}; return \@encode } } || []
189 0 0 $! + 0 || -1
370 0 0 $rcode ||= 'NXDOMAIN'

or 3 conditions

line l !l&&r !l&&!r condition
51 0 0 0 $args{'Suffix'} ||= $ENV{'DNS_SUFFIX'}
56 0 0 0 $args{'SOA'} ||= do { my $res = ($args{'net_dns'} ||= eval { do { require Net::DNS::Resolver::Recurse; return 'Net::DNS::Resolver::Recurse'->new } }); my $soa = {lc $suffix, 1}; my $ip = undef; my $bind_errors = {}; $res->recursion_callback(sub { my $packet = shift(); foreach my $rr ($packet->answer, $packet->authority, $packet->additional) { if ($rr->type eq 'NS' and $$soa{lc $rr->name}) { $$soa{lc $rr->nsdname} = 1; } ; } ; foreach my $rr ($packet->answer, $packet->authority, $packet->additional) { if ($rr->type eq 'CNAME' and $$soa{lc $rr->name}) { $$soa{lc $rr->nsdname} = 1; } ; } ; foreach my $rr ($packet->answer, $packet->authority, $packet->additional) { if ($rr->type eq 'A' and $$soa{lc $rr->name}) { my $try = $rr->rdatastr; unless ($$bind_errors{$try}) { warn "Testing $try ...\n" if $args{'Verbose'}; if ('IO::Socket::INET'->new('LocalAddr', $try, 'Listen', 1)) { $ip = $rr->rdatastr; warn "Automatically determined DNS suffix [$suffix] to have SOA IP [$ip]\n" if $args{'Verbose'}; die "found winner $ip"; } else { $$bind_errors{$try} = $!; warn "Unable to bind to ${try}: $!\n" if $args{'Verbose'}; } ; } ; } ; } ; } ); my $num_soas = 0; while ($num_soas < scalar keys %$soa) { $num_soas = scalar keys %$soa; foreach my $auth (sort keys %$soa) { eval { do { $res->query_dorecursion($auth, 'ANY') } }; last if $ip; } ; last if $ip; } ; unless ($ip) { ($ip) = keys %$bind_errors; if ($ip) { warn "Warning: Unable to bind to $ip but using it for the SOA IP anyway. Specify SOA manually if you don't like this.\n"; } else { die "Unable to determine SOA IP using Suffix [$suffix]. Please correct the DNS authority entries or try another Suffix.\n"; } ; } ; $ip }
57 0 0 0 $args{'net_dns'} ||= eval { do { require Net::DNS::Resolver::Recurse; return 'Net::DNS::Resolver::Recurse'->new } }
118 0 0 0 $args{'LocalAddr'} ||= $args{'SOA'}
140 0 0 0 $qname =~ /^([0-9a-w]{6})\.(\d+)\.([0-9a-w.]+)\.$suffix$/ && $2 == length $3 || $qname =~ /^([0-9a-w]{6})\.()([xz])\.$suffix$/
149 0 0 0 $$self{"_code_array_cache_$prefix"} ||= eval { do { my $code = ref $method eq 'CODE' ? &$method($self, $prefix) : $self->$method($prefix); warn "DEBUG: $method string=[$code]\n" if $$self{'Verbose'}; my(@encode) = (); while ($code =~ s/^(.{1,100})//s) { my $chunk = $1; push @encode, unpack('H*', $chunk); } ; warn Dumper(['code_array', \@encode]) if $$self{'Verbose'}; return \@encode } } || []
292 0 0 0 $len || $$self{'_tcp'}{$sock}