Branch Coverage

blib/lib/Mojo/TFTPd.pm
Criterion Covered Total %
branch 36 56 64.2


line true false branch
69 0 3 $ENV{'MOJO_TFTPD_DEBUG'} ? :
175 0 0 if $$self{'connections'}
189 0 0 unless ($socket)
204 0 0 if $time - $c->timeout < $$c{'timestamp'}
219 1 26 unless (defined $read)
226 10 16 if ($opcode eq 1) { }
4 12 elsif ($opcode eq 2) { }
236 1 11 if (not $connection) { }
6 5 elsif ($opcode == 4) { }
5 0 elsif ($opcode == 3) { }
0 0 elsif ($opcode == 5) { }
240 2 4 if $connection->receive_ack($datagram) and $connection->send_data
243 3 2 if $connection->receive_data($datagram) and $connection->send_ack
265 3 11 unless ($self->has_subscribers($type))
269 1 10 if ($self->max_connections <= keys %{$$self{'connections'};})
287 2 8 if ($rfc{'blksize'})
288 0 2 if $rfc{'blksize'} < 8
289 0 2 if $rfc{'blksize'} > 65464
292 1 0 if ($rfc{'timeout'} and $rfc{'timeout'} >= 0 and $rfc{'timeout'} <= 255)
295 1 9 if ($type eq 'wrq' and $rfc{'tsize'})
301 3 1 $type eq 'rrq' ? :
1 9 if (not $connection->filehandle) { }
9 0 elsif (%rfc and $connection->send_oack or $type eq 'rrq' ? $connection->send_data : $connection->send_ack) { }
324 3 4 if $scheme and not defined $port
330 2 5 if $host eq '*'
343 0 0 unless my $reactor = eval { do { $self->ioloop->reactor } }
345 0 0 if $$self{'checker'}
346 0 0 if $$self{'socket'}