Branch Coverage

blib/lib/Protocol/HTTP2/Stream.pm
Criterion Covered Total %
branch 79 112 70.5


line true false branch
23 572 164 @_ == 2 ? :
0 736 !exists($_[0]{'streams'}{$_[1]}) ? :
30 2 40 if $self->goaway
33 40 0 $self->{'type'} == 1 ? :
20 20 if exists $self->{'streams'}{$self->{'type'} == 1 ? 1 : 2}
47 0 42 $stream_id < $self->{'last_peer_stream'} || $stream_id % 2 == ($self->{'type'} == 1) ? :
0 42 if ($stream_id < $self->{'last_peer_stream'} || $stream_id % 2 == ($self->{'type'} == 1) ? 1 : $self->goaway)
56 0 42 if ($self->dec_setting(3) <= $self->{'active_peer_streams'})
73 34 8 if exists $self->{'on_new_peer_stream'}
80 35 104 unless exists $self->{'streams'}{$stream_id}
90 0 151 unless exists $self->{'streams'}{$stream_id}
93 151 0 if (@_)
96 1 150 if ($pending) { }
101 0 150 if exists $self->{'on_change_state'}
106 70 80 if (exists $s->{'cb'} and exists $s->{'cb'}{$s->{'state'}})
113 70 80 if ($new_state == 5)
116 34 36 if $self->{'active_peer_streams'} and $stream_id % 2 ^ $self->{'type'} == 1
120 360 264 if grep {$key eq $_;} 'state', 'weight', 'stream_dep', 'fcw_recv', 'fcw_send', 'reset'
136 0 262 unless exists $self->{'streams'}{$stream_id}
138 2 260 if (@_)
141 1 1 defined $s->{'pending_state'} ? :
149 0 71 unless exists $self->{'streams'}{$stream_id}
157 0 10 unless exists $self->{'streams'}{$stream_id}
165 0 90 unless exists $self->{'streams'}{$stream_id}
168 23 67 if (@_)
171 5 18 if (exists $s->{'frame_cb'} and exists $s->{'frame_cb'}{&DATA}) { }
187 0 72 unless exists $self->{'streams'}{$stream_id}
196 0 72 unless defined $res
206 0 72 unless $self->validate_headers($eh, $stream_id, $is_response)
208 0 72 if ($s->{'promised_sid'}) { }
0 72 elsif ($is_trailer) { }
219 5 67 if (exists $s->{'frame_cb'} and exists $s->{'frame_cb'}{&HEADERS})
235 36 36 $is_response ? :
241 0 72 if (my $t = $self->stream_trailer($stream_id))
244 0 0 unless (exists $t->{$h})
256 180 53 if ($h =~ /^\:/)
257 0 180 if (not $pseudo_flag) { }
0 180 elsif (not grep({$_ eq $h;} @h)) { }
0 180 elsif (exists $pseudo_hash{$h}) { }
278 25 28 if $pseudo_flag
280 0 53 if ($h eq 'connection') { }
0 53 elsif ($h eq 'te' and $v ne 'trailers') { }
2 51 elsif ($h eq 'content-length') { }
0 51 elsif ($h eq 'trailer') { }
295 0 0 if (grep {exists $th{$_};} 'transfer-encoding', 'content-length', 'host', 'authentication', 'cache-control', 'expect', 'max-forwards', 'pragma', 'range', 'te', 'content-encoding', 'content-type', 'content-range', 'trailer')
312 180 0 if exists $pseudo_hash{$h}
333 0 154 unless exists $self->{'streams'}{$stream_id}
336 102 52 if (@_)
363 0 3 unless my $s = $self->{'streams'}{$stream_id}
365 1 2 if (length $s->{'blocked_data'} and $self->stream_fcw_send($stream_id) > 0)
376 0 7 unless exists $self->{'streams'}{$stream_id} and $stream_dep == 0 || exists $self->{'streams'}{$stream_dep} and $stream_id != $stream_dep
380 4 3 if ($s->{$stream_id}{'stream_dep'} != $stream_dep)
383 4 0 if ($stream_dep != 0)
386 4 1 unless $sid == $stream_id
399 1 6 if ($exclusive)
404 1 2 if $s->{$sid}{'stream_dep'} != $stream_dep or $sid == $stream_id