Branch Coverage

blib/lib/Mojo/TFTPd.pm
Criterion Covered Total %
branch 45 60 75.0


line true false branch
31 0 0 if $self->{'connections'}
38 0 0 unless $socket
54 8 0 if $connection->{'timer'}
63 1 131124 unless defined(my $read = $socket->recv(my $datagram, 65468))
67 15 131109 if ($opcode eq 1) { }
7 131102 elsif ($opcode eq 2) { }
75 3 131099 unless $connection
77 65553 65546 if ($opcode == 4) { }
65546 0 elsif ($opcode == 3) { }
0 0 elsif ($opcode == 5) { }
78 65548 5 $connection->receive_ack($datagram) ? :
83 65543 3 $connection->receive_data($datagram) ? :
103 4 18 unless $self->has_subscribers($type)
105 1 17 if $self->max_connections <= keys %{$$self{"connections"};}
108 4 13 $self->retransmit ? :
121 5 12 if ($rfc{'blksize'})
122 0 5 if $rfc{'blksize'} < 8
123 0 5 if $rfc{'blksize'} > 65464
126 1 0 if ($rfc{'timeout'} and $rfc{'timeout'} >= 0 and $rfc{'timeout'} <= 255)
129 1 3 if ($type eq "wrq" and $rfc{'tsize'})
135 5 2 $type eq 'rrq' ? :
2 15 if (not $connection->filehandle) { }
8 7 elsif (%rfc and $connection->send_oack) { }
7 0 elsif ($type eq 'rrq' ? $connection->send_data : $connection->send_ack) { }
161 3 4 if $scheme and not defined $port
163 2 5 if $host eq "*"
171 131091 17 if $connection->{'timer'}
175 0 0 unless $connection->send_retransmit
181 0 2 if ${^GLOBAL_PHASE} eq "DESTRUCT"
183 1 1 if $self->{'socket'}