Branch Coverage

blib/lib/Protocol/HTTP2/Stream.pm
Criterion Covered Total %
branch 84 128 65.6


line true false branch
13 0 16 if $self->goaway
15 16 0 $$self{'type'} == 1 ? :
0 16 if exists $$self{'streams'}{$$self{'type'} == 1 ? 1 : 2}
30 0 18 $stream_id < $$self{'last_peer_stream'} || $stream_id % 2 == ($$self{'type'} == 1) ? :
0 18 if ($stream_id < $$self{'last_peer_stream'} || $stream_id % 2 == ($$self{'type'} == 1) ? 1 : $self->goaway)
39 0 18 if ($self->dec_setting(3) <= $$self{'active_peer_streams'})
55 10 8 if exists $$self{'on_new_peer_stream'}
63 11 50 unless exists $$self{'streams'}{$stream_id}
73 0 51 unless exists $$self{'streams'}{$stream_id}
76 51 0 if (@_)
79 1 50 if ($pending) { }
83 0 50 if exists $$self{'on_change_state'}
89 22 28 if (exists $$s{'cb'} and exists $$s{'cb'}{$$s{'state'}})
96 22 28 if ($new_state == 5)
97 10 12 if $$self{'active_peer_streams'} and $stream_id % 2 ^ $$self{'type'} == 1
103 110 80 if grep {$key eq $_;} 'state', 'weight', 'stream_dep', 'fcw_recv', 'fcw_send'
119 0 106 unless exists $$self{'streams'}{$stream_id}
121 2 104 if (@_)
123 1 1 defined $$s{'pending_state'} ? :
132 0 104 unless exists $$self{'streams'}{$stream_id}
134 0 104 if @_
141 0 23 unless exists $$self{'streams'}{$stream_id}
149 0 10 unless exists $$self{'streams'}{$stream_id}
157 0 36 unless exists $$self{'streams'}{$stream_id}
160 17 19 if (@_)
163 5 12 if (exists $$s{'frame_cb'} and exists $$s{'frame_cb'}{&DATA}) { }
180 0 24 unless exists $$self{'streams'}{$stream_id}
183 24 0 if @_
191 0 22 unless exists $$self{'streams'}{$stream_id}
192 0 22 if @_
199 0 0 unless exists $$self{'streams'}{$stream_id}
207 0 4 unless exists $$self{'streams'}{$stream_id}
208 2 2 if @_
215 0 24 unless exists $$self{'streams'}{$stream_id}
224 0 24 unless defined $res
233 0 24 unless $self->validate_headers($eh, $stream_id, $is_response)
235 0 24 if ($$s{'promised_sid'}) { }
243 5 19 if (exists $$s{'frame_cb'} and exists $$s{'frame_cb'}{&HEADERS})
259 12 12 $is_response ? :
265 60 50 if ($h =~ /^\:/)
266 0 60 if (not $pseudo_flag) { }
0 60 elsif (not grep({$_ eq $h;} @h)) { }
0 60 elsif (exists $pseudo_hash{$h}) { }
287 22 28 if $pseudo_flag
289 0 50 if ($h eq 'connection') { }
0 50 elsif ($h eq 'te' and $v ne 'trailers') { }
2 48 elsif ($h eq 'content-length') { }
305 60 0 if exists $pseudo_hash{$h}
326 0 62 unless exists $$self{'streams'}{$stream_id}
329 42 20 if (@_)
356 0 20 unless my $s = $$self{'streams'}{$stream_id}
358 0 20 if @_
364 0 0 unless my $s = $$self{'streams'}{$stream_id}
366 0 0 if (length $$s{'blocked_data'} and $self->stream_fcw_send($stream_id) != 0)
375 0 2 unless exists $$self{'streams'}{$stream_id}
378 2 0 if defined $weight
384 0 25 unless exists $$self{'streams'}{$stream_id}
387 5 20 if defined $end_flag
393 0 7 unless exists $$self{'streams'}{$stream_id}
396 4 3 if ($$s{$stream_id}{'stream_dep'} != $stream_dep)
399 4 0 if ($stream_dep != 0)
402 4 1 unless $sid == $stream_id
415 1 6 if ($exclusive)
420 1 2 if $$s{$sid}{'stream_dep'} != $stream_dep or $sid == $stream_id