Branch Coverage

blib/lib/Net/TFTPd.pm
Criterion Covered Total %
branch 0 192 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')
174 0 0 if (defined $cfg{'V6Only'})
176 0 0 unless ($HAVE_IO_Socket_IP)
185 0 0 if ($cfg{'LocalAddr'})
190 0 0 if ($HAVE_IO_Socket_IP) { }
192 0 0 if (my $udpserver = 'IO::Socket::IP'->new(%params)) { }
216 0 0 if (my $udpserver = 'IO::Socket::INET'->new(%params)) { }
258 0 0 if $key =~ /^\_.+\_$/
274 0 0 if (select $rout = $rin, undef, $eout = $ein, $Timeout) { }
277 0 0 if ($udpserver->recv($datagram, 65468)) { }
299 0 0 if (scalar @datain >= 2)
329 0 0 if (defined $self->newSOCK) { }
332 0 0 if ($self->{'_REQUEST_'}{'Mode'} ne 'OCTET' and $self->{'_REQUEST_'}{'Mode'} ne 'NETASCII')
341 0 0 if ($self->{'_REQUEST_'}{'OPCODE'} eq 1) { }
0 0 elsif ($self->{'_REQUEST_'}{'OPCODE'} eq 2) { }
346 0 0 if ($self->{'Readable'}) { }
349 0 0 if ($self->{'_REQUEST_'}{'FileName'} =~ m[\.\.[\\/]])
357 0 0 if (defined $self->checkFILE) { }
360 0 0 if (defined $self->negotiateOPTS) { }
363 0 0 if (defined $self->openFILE) { }
366 0 0 if (defined $self->sendFILE) { }
412 0 0 if ($self->{'Writable'}) { }
415 0 0 if ($self->{'_REQUEST_'}{'FileName'} =~ m[\.\.[\\/]])
423 0 0 if (not defined $self->checkFILE) { }
426 0 0 if (defined $self->openFILE) { }
429 0 0 if (defined $self->negotiateOPTS) { }
432 0 0 if (defined $self->recvFILE) { }
579 0 0 if ($self->{'Address'})
585 0 0 if ($HAVE_IO_Socket_IP) { }
587 0 0 if (my $udpserver = 'IO::Socket::IP'->new(%params)) { }
600 0 0 if (my $udpserver = 'IO::Socket::INET'->new(%params)) { }
623 0 0 if ($self->{'_REQUEST_'}{'RFC2347'}) { }
628 0 0 if (uc $option eq 'BLKSIZE') { }
0 0 elsif (uc $option eq 'TSIZE') { }
0 0 elsif (uc $option eq 'TIMEOUT') { }
631 0 0 if ($self->{'_REQUEST_'}{'RFC2347'}{$option} > 65464 or $self->{'_REQUEST_'}{'RFC2347'}{$option} < 8) { }
644 0 0 if ($self->{'_REQUEST_'}{'OPCODE'} eq 1) { }
656 0 0 if ($self->{'_REQUEST_'}{'RFC2347'}{$option} > 60 or $self->{'_REQUEST_'}{'RFC2347'}{$option} < 1) { }
673 0 0 if ($self->{'_REQUEST_'}{'OPCODE'} eq 2)
675 0 0 if ($self->{'FileSize'} and $self->{'BlkSize'})
686 0 0 if ($self->{'_REQUEST_'}{'OPCODE'} eq 2) { }
689 0 0 if ($self->{'_UDPSERVER_'}->send("\000\cD\000\000")) { }
717 0 0 if ($self->{'_REQUEST_'}{'PREVACK'} < $self->{'_REQUEST_'}{'LASTACK'}) { }
724 0 0 if (defined $bytes) { }
751 0 0 if ($self->{'_REQUEST_'}{'PREVBLK'} > $self->{'_REQUEST_'}{'LASTBLK'}) { }
0 0 elsif ($self->{'_REQUEST_'}{'LASTBLK'} eq $self->{'_REQUEST_'}{'PREVBLK'} + 1) { }
782 0 0 if ($self->{'_REQUEST_'}{'LASTACK'} < $self->{'_REQUEST_'}{'LASTBLK'}) { }
785 0 0 if (defined $self->readFILE(\$datablk)) { }
790 0 0 if ($self->sendDATA(\$datablk)) { }
793 0 0 if ($self->{'CallBack'})
833 0 0 if ($self->recvDATA(\$datablk)) { }
836 0 0 if (defined $self->writeFILE(\$datablk)) { }
841 0 0 if (defined $udpserver->send(pack('nn', 4, $self->{'_REQUEST_'}{'LASTBLK'}))) { }
846 0 0 if (length $datablk < $self->{'BlkSize'}) { }
894 0 0 if (select $rout = $rin, undef, $eout = $ein, $self->{'ACKtimeout'}) { }
897 0 0 if ($udpserver->recv($datagram, $self->{'BlkSize'} + 4)) { }
901 0 0 if ($opcode eq 3) { }
0 0 elsif ($opcode eq 5) { }
907 0 0 if ($self->{'CallBack'})
958 0 0 if ($udpserver->send(pack('nna*', 3, $self->{'_REQUEST_'}{'LASTACK'} + 1, $$datablk))) { }
965 0 0 if (select $rout = $rin, undef, $eout = $ein, $self->{'ACKtimeout'}) { }
968 0 0 if ($udpserver->recv($datagram, 65468)) { }
972 0 0 if ($opcode eq 4) { }
0 0 elsif ($opcode eq 5) { }
977 0 0 if (int(($self->{'_REQUEST_'}{'LASTACK'} + 1) % 65536) == unpack('n', $datain))
1005 0 0 if $debug
1027 0 0 if ($self->{'_REQUEST_'}{'OPCODE'} eq 1) { }
0 0 elsif ($self->{'_REQUEST_'}{'OPCODE'} eq 2) { }
1032 0 0 if (open RFH, '<' . $self->{'_REQUEST_'}{'FileName'}) { }
1035 0 0 if ($self->{'_REQUEST_'}{'Mode'} eq 'OCTET')
1059 0 0 if (open WFH, '>' . $self->{'_REQUEST_'}{'FileName'}) { }
1062 0 0 if ($self->{'_REQUEST_'}{'Mode'} eq 'OCTET')
1096 0 0 if ($self->{'_REQUEST_'}{'_FH_'}) { }
1098 0 0 if (close $self->{'_REQUEST_'}{'_FH_'}) { }
1126 0 0 if ($self->{'FileName'}) { }
0 0 elsif ($self->{'RootDir'}) { }
1131 0 0 if ($self->{'FileName'} =~ /$reqfile/ and -e $self->{'FileName'})
1144 0 0 if (-e $reqfile)
1172 0 0 if ($udpserver->send(pack('na*', 6, $data))) { }
1175 0 0 if ($self->{'_REQUEST_'}{'OPCODE'} eq 1) { }
0 0 elsif ($self->{'_REQUEST_'}{'OPCODE'} eq 2) { }
1182 0 0 if (select $rout = $rin, undef, $eout = $ein, $self->{'ACKtimeout'}) { }
1185 0 0 if ($udpserver->recv($datagram, 65468)) { }
1189 0 0 if ($opcode == 4) { }
0 0 elsif ($opcode == 5) { }
1193 0 0 if ($lastack)
1224 0 0 if $debug
1253 0 0 unless $errmsg
1257 0 0 if ($udpserver->send(pack('nnZ*', 5, $errcode, $errmsg))) { }