Branch Coverage

blib/lib/Net/TFTPd.pm
Criterion Covered Total %
branch 0 188 0.0


line true false branch
122 0 0 unless $cfg{'FileName'} or $cfg{'RootDir'}
124 0 0 if ($cfg{'RootDir'} and not -d $cfg{'RootDir'})
130 0 0 if ($cfg{'FileName'} and not -e $cfg{'FileName'})
142 0 0 if (defined $cfg{'Family'}) { }
144 0 0 if ($cfg{'Family'} =~ /^(?:(?:(:?ip)?v?(?:4|6))|${\2;}|$AF_INET6)$/) { }
146 0 0 if ($cfg{'Family'} =~ /^(?:(?:(:?ip)?v?4)|${\2;})$/) { }
152 0 0 unless ($HAVE_IO_Socket_IP)
158 0 0 if ($^O ne 'MSWin32')
175 0 0 if ($cfg{'LocalAddr'})
180 0 0 if ($HAVE_IO_Socket_IP) { }
182 0 0 if (my $udpserver = 'IO::Socket::IP'->new(%params)) { }
206 0 0 if (my $udpserver = 'IO::Socket::INET'->new(%params)) { }
248 0 0 if $key =~ /^\_.+\_$/
264 0 0 if (select $rout = $rin, undef, $eout = $ein, $Timeout) { }
267 0 0 if ($udpserver->recv($datagram, 65468)) { }
289 0 0 if (scalar @datain >= 2)
319 0 0 if (defined $self->newSOCK) { }
322 0 0 if ($$self{'_REQUEST_'}{'Mode'} ne 'OCTET' and $$self{'_REQUEST_'}{'Mode'} ne 'NETASCII')
331 0 0 if ($$self{'_REQUEST_'}{'OPCODE'} eq 1) { }
0 0 elsif ($$self{'_REQUEST_'}{'OPCODE'} eq 2) { }
336 0 0 if ($$self{'Readable'}) { }
339 0 0 if ($$self{'_REQUEST_'}{'FileName'} =~ m[\.\.[\\/]])
347 0 0 if (defined $self->checkFILE) { }
350 0 0 if (defined $self->negotiateOPTS) { }
353 0 0 if (defined $self->openFILE) { }
356 0 0 if (defined $self->sendFILE) { }
402 0 0 if ($$self{'Writable'}) { }
405 0 0 if ($$self{'_REQUEST_'}{'FileName'} =~ m[\.\.[\\/]])
413 0 0 if (not defined $self->checkFILE) { }
416 0 0 if (defined $self->openFILE) { }
419 0 0 if (defined $self->negotiateOPTS) { }
422 0 0 if (defined $self->recvFILE) { }
569 0 0 if ($$self{'Address'})
575 0 0 if ($HAVE_IO_Socket_IP) { }
577 0 0 if (my $udpserver = 'IO::Socket::IP'->new(%params)) { }
590 0 0 if (my $udpserver = 'IO::Socket::INET'->new(%params)) { }
613 0 0 if ($$self{'_REQUEST_'}{'RFC2347'}) { }
618 0 0 if (uc $option eq 'BLKSIZE') { }
0 0 elsif (uc $option eq 'TSIZE') { }
0 0 elsif (uc $option eq 'TIMEOUT') { }
621 0 0 if ($$self{'_REQUEST_'}{'RFC2347'}{$option} > 65464 or $$self{'_REQUEST_'}{'RFC2347'}{$option} < 8) { }
634 0 0 if ($$self{'_REQUEST_'}{'OPCODE'} eq 1) { }
646 0 0 if ($$self{'_REQUEST_'}{'RFC2347'}{$option} > 60 or $$self{'_REQUEST_'}{'RFC2347'}{$option} < 1) { }
663 0 0 if ($$self{'_REQUEST_'}{'OPCODE'} eq 2)
665 0 0 if ($$self{'FileSize'} and $$self{'BlkSize'})
676 0 0 if ($$self{'_REQUEST_'}{'OPCODE'} eq 2) { }
679 0 0 if ($$self{'_UDPSERVER_'}->send("\000\cD\000\000")) { }
707 0 0 if ($$self{'_REQUEST_'}{'PREVACK'} < $$self{'_REQUEST_'}{'LASTACK'}) { }
714 0 0 if (defined $bytes) { }
741 0 0 if ($$self{'_REQUEST_'}{'PREVBLK'} > $$self{'_REQUEST_'}{'LASTBLK'}) { }
0 0 elsif ($$self{'_REQUEST_'}{'LASTBLK'} eq $$self{'_REQUEST_'}{'PREVBLK'} + 1) { }
772 0 0 if ($$self{'_REQUEST_'}{'LASTACK'} < $$self{'_REQUEST_'}{'LASTBLK'}) { }
775 0 0 if (defined $self->readFILE(\$datablk)) { }
780 0 0 if ($self->sendDATA(\$datablk)) { }
783 0 0 if ($$self{'CallBack'})
823 0 0 if ($self->recvDATA(\$datablk)) { }
826 0 0 if (defined $self->writeFILE(\$datablk)) { }
831 0 0 if (defined $udpserver->send(pack('nn', 4, $$self{'_REQUEST_'}{'LASTBLK'}))) { }
836 0 0 if (length $datablk < $$self{'BlkSize'}) { }
884 0 0 if (select $rout = $rin, undef, $eout = $ein, $$self{'ACKtimeout'}) { }
887 0 0 if ($udpserver->recv($datagram, $$self{'BlkSize'} + 4)) { }
891 0 0 if ($opcode eq 3) { }
0 0 elsif ($opcode eq 5) { }
897 0 0 if ($$self{'CallBack'})
948 0 0 if ($udpserver->send(pack('nna*', 3, $$self{'_REQUEST_'}{'LASTACK'} + 1, $$datablk))) { }
955 0 0 if (select $rout = $rin, undef, $eout = $ein, $$self{'ACKtimeout'}) { }
958 0 0 if ($udpserver->recv($datagram, 65468)) { }
962 0 0 if ($opcode eq 4) { }
0 0 elsif ($opcode eq 5) { }
967 0 0 if (int(($$self{'_REQUEST_'}{'LASTACK'} + 1) % 65536) == unpack('n', $datain))
995 0 0 if $debug
1017 0 0 if ($$self{'_REQUEST_'}{'OPCODE'} eq 1) { }
0 0 elsif ($$self{'_REQUEST_'}{'OPCODE'} eq 2) { }
1022 0 0 if (open RFH, '<' . $$self{'_REQUEST_'}{'FileName'}) { }
1025 0 0 if ($$self{'_REQUEST_'}{'Mode'} eq 'OCTET')
1049 0 0 if (open WFH, '>' . $$self{'_REQUEST_'}{'FileName'}) { }
1052 0 0 if ($$self{'_REQUEST_'}{'Mode'} eq 'OCTET')
1086 0 0 if ($$self{'_REQUEST_'}{'_FH_'}) { }
1088 0 0 if (close $$self{'_REQUEST_'}{'_FH_'}) { }
1116 0 0 if ($$self{'FileName'}) { }
0 0 elsif ($$self{'RootDir'}) { }
1121 0 0 if ($$self{'FileName'} =~ /$reqfile/ and -e $$self{'FileName'})
1134 0 0 if (-e $reqfile)
1162 0 0 if ($udpserver->send(pack('na*', 6, $data))) { }
1165 0 0 if ($$self{'_REQUEST_'}{'OPCODE'} eq 1) { }
0 0 elsif ($$self{'_REQUEST_'}{'OPCODE'} eq 2) { }
1172 0 0 if (select $rout = $rin, undef, $eout = $ein, $$self{'ACKtimeout'}) { }
1175 0 0 if ($udpserver->recv($datagram, 65468)) { }
1179 0 0 if ($opcode == 4) { }
0 0 elsif ($opcode == 5) { }
1183 0 0 if ($lastack)
1214 0 0 if $debug
1243 0 0 unless $errmsg
1247 0 0 if ($udpserver->send(pack('nnZ*', 5, $errcode, $errmsg))) { }