| 1 | package Unblock::HTTP2::Client; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 28 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 28 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 28 | ▶ | use Carp qw(croak); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 28 | ▶ | use Scalar::Util qw(weaken); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 28 | ▶ | use parent 'Unblock::HTTP2::_Connection'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 28 | ▶ | use Unblock::HTTP2::_Headers; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 28 | ▶ | use Unblock::HTTP2::Transaction; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 28 | ▶ | use Uniform::HTTP::Request; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 28 | our $VERSION = '0.11'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 28 | ▶ | use constant { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 28 | H2_DATA => 0, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | H2_HEADERS => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | H2_GOAWAY => 7, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | H2_END_STREAM => 0x1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | H2_PROTOCOL_ERROR => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | H2_INTERNAL_ERROR => 2, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | H2_CANCEL => 8, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | H2_ENHANCE_YOUR_CALM => 11, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 28 | }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 28 | my $BODY_HIGH_WATER = 65_536; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 28 | my $BODY_LOW_WATER = 32_768; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 45 | ▶ | sub new { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=21 SCAR=34.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 45 | my ($class, %option) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 45 | my $transport = delete $option{transport}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | 45 | my %callbacks; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | 45 | for my $name (qw( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | on_settings on_settings_ack on_ping on_ping_ack on_invalid_frame | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | )) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 225 | ▶ | next unless exists $option{$name}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 7 | my $callback = delete $option{$name}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | 7 | ▶ | croak "new(): $name must be a coderef" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $callback and ref $callback ne "CODE"
MC/DC0%0/2
defined $callback and ref $callback ne "CODE"
defined $callback
ref $callback ne "CODE"
Truth table33%1/3
A and B
A= defined $callbackB= ref $callback ne "CODE"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | if defined($callback) && ref($callback) ne 'CODE'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 7 | ▶ | $callbacks{$name} = $callback if $callback; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | my $settings = exists($option{settings}) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | ? delete($option{settings}) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | 45 | ▶ | : {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 45 | ▶ | croak 'new(): settings must be a hash reference' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | unless ref($settings) eq 'HASH'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | my $max_active_transactions = exists($option{max_active_transactions}) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | ? delete($option{max_active_transactions}) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | 45 | ▶ | : 100; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | my $max_header_list_size = exists($option{max_header_list_size}) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | ? delete($option{max_header_list_size}) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 45 | ▶ | : 65_536; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | 45 | ▶ | croak 'new(): max_active_transactions must be a positive integer' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%3/9
defined $max_active_transactions and not ref $max_active_transactions and $max_active_transactions =~ /\A[0-9]+\z/ and $max_active_transactions > 0
defined $max_active_transactions and not ref $max_active_transactions and $max_active_transactions =~ /\A[0-9]+\z/
defined $max_active_transactions and not ref $max_active_transactions
MC/DC0%0/4
defined $max_active_transactions and not ref $max_active_transactions and $max_active_transactions =~ /\A[0-9]+\z/ and $max_active_transactions > 0
defined $max_active_transactions
not ref $max_active_transactions
$max_active_transactions =~ /\A[0-9]+\z/
$max_active_transactions > 0
Truth table20%1/5
A and not(B) and C and D
A= defined $max_active_transactionsB= not ref $max_active_transactionsC= $max_active_transactions =~ /\A[0-9]+\z/D= $max_active_transactions > 0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | unless defined($max_active_transactions) && !ref($max_active_transactions) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | && $max_active_transactions =~ /\A[0-9]+\z/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | && $max_active_transactions > 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | 45 | ▶ | croak 'new(): max_header_list_size must be a positive integer' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%3/9
defined $max_header_list_size and not ref $max_header_list_size and $max_header_list_size =~ /\A[0-9]+\z/ and $max_header_list_size > 0
defined $max_header_list_size and not ref $max_header_list_size and $max_header_list_size =~ /\A[0-9]+\z/
defined $max_header_list_size and not ref $max_header_list_size
MC/DC0%0/4
defined $max_header_list_size and not ref $max_header_list_size and $max_header_list_size =~ /\A[0-9]+\z/ and $max_header_list_size > 0
defined $max_header_list_size
not ref $max_header_list_size
$max_header_list_size =~ /\A[0-9]+\z/
$max_header_list_size > 0
Truth table20%1/5
A and not(B) and C and D
A= defined $max_header_list_sizeB= not ref $max_header_list_sizeC= $max_header_list_size =~ /\A[0-9]+\z/D= $max_header_list_size > 0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | unless defined($max_header_list_size) && !ref($max_header_list_size) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | && $max_header_list_size =~ /\A[0-9]+\z/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | && $max_header_list_size > 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | 45 | ▶ | croak 'new(): unknown options: ' . join(', ', sort keys %option) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | if %option; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | 45 | require Unblock::HTTP2::_nghttp2; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | 45 | ▶ | croak 'new(): nghttp2 library is unavailable' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | unless Unblock::HTTP2::_nghttp2->available; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | 45 | my $self = bless { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | draining => 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | max_active_transactions => 0 + $max_active_transactions, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | max_header_list_size => 0 + $max_header_list_size, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | receive => {}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | providers => {}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | peer_goaway => undef, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | }, $class; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | 45 | my $weak = $self; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | 45 | weaken($weak); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | my $session = Unblock::HTTP2::_nghttp2::Session->new_client( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | max_header_list_size => $self->{max_header_list_size}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | callbacks => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | 30 | ▶ | on_begin_headers => sub { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=7.2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | 30 | ▶ | my $self = $weak or return 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | 30 | return $self->_on_begin_headers(@_); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | 158 | ▶ | on_frame_recv => sub { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=7.2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | 158 | ▶ | my $self = $weak or return 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | 158 | return $self->_on_frame_recv(@_); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | 35 | ▶ | on_data_chunk_recv => sub { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=7.2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | 35 | ▶ | my $self = $weak or return 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | 35 | return $self->_on_data_chunk_recv(@_); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | 30 | ▶ | on_stream_close => sub { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=7.2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | 30 | ▶ | my $self = $weak or return 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 30 | return $self->_on_stream_close(@_); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | 1 | ▶ | on_invalid_frame => sub { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=7.2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | 1 | ▶ | my $self = $weak or return 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | 1 | return $self->_on_invalid_frame(@_); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | 45 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | 45 | $self->_initialize_connection( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | $session, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | role => 'client', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | callbacks => \%callbacks, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | transport => $transport, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | my %initial_settings = ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | max_concurrent_streams => 100, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | max_header_list_size => $self->{max_header_list_size}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | 45 | enable_push => 0, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | no_rfc7540_priorities => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | %$settings, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | 45 | $self->_submit_settings('new()', \%initial_settings); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | 45 | ▶ | $self->_transport_sync if $self->{transport_attached}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | 45 | return $self; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | 2 | ▶ | sub draining { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
draining: called CC=2 SCAR=7.6
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | 2 | ▶ | return $_[0]{draining} ? 1 : 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | 3 | ▶ | sub peer_goaway { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
peer_goaway: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | 3 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | 3 | ▶ | return unless $self->{peer_goaway}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | 3 | return { %{ $self->{peer_goaway} } }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | 1 | ▶ | sub drain { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
drain: called CC=3 SCAR=12.5
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | 1 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | 1 | ▶ | return $self if $self->is_closed || $self->{draining}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$self->is_closed or $self->{"draining"}
MC/DC0%0/2
$self->is_closed or $self->{"draining"}
$self->is_closed
$self->{"draining"}
Truth table33%1/3
A or B
A= $self->is_closedB= $self->{"draining"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | 1 | return $self->goaway(error_code => 0); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | 46 | ▶ | sub can_open_transaction { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
can_open_transaction: called CC=5 SCAR=16.1
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | 46 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | 46 | ▶ | return 0 if $self->is_closed || $self->{draining}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$self->is_closed or $self->{"draining"}
MC/DC50%1/2
$self->is_closed or $self->{"draining"}
$self->is_closed
$self->{"draining"}
Truth table66%2/3
A or B
A= $self->is_closedB= $self->{"draining"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | 43 | my $limit = $self->{max_active_transactions}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | 43 | my $peer_limit = $self->peer_setting('max_concurrent_streams'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | 43 | ▶ | $limit = $peer_limit if $peer_limit < $limit; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | 43 | ▶ | return $self->transaction_count < $limit ? 1 : 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | 40 | ▶ | sub request { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
request: called CC=39 SCAR=39.2
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | 40 | my ($self, @arg) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | 40 | my ($request, %option); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | 40 | ▶ | if (@arg && ref($arg[0])) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
@arg and ref $arg[0]
MC/DC50%1/2
@arg and ref $arg[0]
@arg
ref $arg[0]
Truth table66%2/3
A and B
A= @argB= ref $arg[0]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | 36 | $request = shift @arg; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | 36 | ▶ | croak 'request(): options must be key/value pairs' if @arg % 2; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | 36 | %option = @arg; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | 4 | ▶ | croak 'request(): fields must be key/value pairs' if @arg % 2; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | 4 | my %field = @arg; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | 4 | for my $name (qw( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | stream_body on_response on_body on_complete on_error | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | on_informational on_drain | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | )) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | 28 | ▶ | $option{$name} = delete $field{$name} if exists $field{$name}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | 4 | $request = Uniform::HTTP::Request->new(%field); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | 40 | ▶ | croak 'request(): connection is closed' if $self->is_closed; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | 40 | ▶ | croak 'request(): connection cannot accept another transaction' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | unless $self->can_open_transaction; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | 38 | my $native_message = Unblock::HTTP2::_Headers->native_message($request); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | 38 | ▶ | croak 'request(): requires the Uniform HTTP request contract' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$native_message or Unblock::HTTP2::_Headers::_request_contract($request)
MC/DC0%0/2
$native_message or Unblock::HTTP2::_Headers::_request_contract($request)
$native_message
Unblock::HTTP2::_Headers::_request_contract($request)
Truth table33%1/3
A or B
A= $native_messageB= Unblock::HTTP2::_Headers::_request_contract($request)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | unless $native_message | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | || Unblock::HTTP2::_Headers::_request_contract($request); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | 38 | ▶ | if (defined($request->protocol) && length($request->protocol)) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $request->protocol and length $request->protocol
MC/DC50%1/2
defined $request->protocol and length $request->protocol
defined $request->protocol
length $request->protocol
Truth table66%2/3
A and B
A= defined $request->protocolB= length $request->protocol
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | 2 | my $enabled = $self->peer_setting('enable_connect_protocol'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | 2 | ▶ | croak 'request(): peer has not enabled Extended CONNECT' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | unless $enabled == 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | my $stream_body = exists($option{stream_body}) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | ? delete($option{stream_body}) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | 37 | ▶ | : 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | 37 | ▶ | croak 'request(): stream_body must be zero or one' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
not defined $stream_body or ref $stream_body or not "$stream_body" =~ /\A[01]\z/
not defined $stream_body or ref $stream_body
MC/DC0%0/3
not defined $stream_body or ref $stream_body or not "$stream_body" =~ /\A[01]\z/
not defined $stream_body
ref $stream_body
not "$stream_body" =~ /\A[01]\z/
Truth table25%1/4
not(A) or B or not(C)
A= not defined $stream_bodyB= ref $stream_bodyC= not "$stream_body" =~ /\A[01]\z/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | if !defined($stream_body) || ref($stream_body) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | || "$stream_body" !~ /\A[01]\z/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | 37 | ▶ | $stream_body = $stream_body ? 1 : 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | 37 | my %callbacks; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | 37 | for my $name (qw( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | on_response on_body on_complete on_error on_informational on_drain | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | )) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | 222 | ▶ | next unless exists $option{$name}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | 79 | my $callback = delete $option{$name}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | 79 | ▶ | croak "request(): $name must be a coderef" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $callback and ref $callback ne "CODE"
MC/DC0%0/2
defined $callback and ref $callback ne "CODE"
defined $callback
ref $callback ne "CODE"
Truth table33%1/3
A and B
A= defined $callbackB= ref $callback ne "CODE"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | if defined($callback) && ref($callback) ne 'CODE'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | 79 | ▶ | $callbacks{$name} = $callback if $callback; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | 37 | ▶ | croak 'request(): unknown options: ' . join(', ', sort keys %option) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | if %option; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | croak 'request(): on_drain requires stream_body' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | 37 | ▶ | if $callbacks{on_drain} && !$stream_body; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$callbacks{"on_drain"} and not $stream_body
MC/DC0%0/2
$callbacks{"on_drain"} and not $stream_body
$callbacks{"on_drain"}
not $stream_body
Truth table66%2/3
A and not(B)
A= $callbacks{"on_drain"}B= not $stream_body
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | 37 | ▶ | croak 'request(): stream_body cannot be combined with a buffered body' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$stream_body and $request->has_buffered_body
MC/DC0%0/2
$stream_body and $request->has_buffered_body
$stream_body
$request->has_buffered_body
Truth table66%2/3
A and B
A= $stream_bodyB= $request->has_buffered_body
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | if $stream_body && $request->has_buffered_body; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | 37 | ▶ | my $block = $native_message | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | ? undef | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | : Unblock::HTTP2::_Headers->request_headers($request); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | 37 | my $trailers = Unblock::HTTP2::_Headers->trailer_fields( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | 'request()', $request, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | 37 | my ($provider, $body); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | 37 | ▶ | if ($stream_body || @$trailers) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition100%3/3
$stream_body or @$trailers
MC/DC100%2/2
$stream_body or @$trailers
$stream_body
@$trailers
Truth table100%3/3
A or B
A= $stream_bodyB= @$trailers
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | 8 | $provider = { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | queue => '', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | eof => 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | blocked => 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | stream_id => undef, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | trailers => undef, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | trailer_submitted => 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 235 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 236 | 8 | ▶ | if (!$stream_body) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | 1 | ▶ | $provider->{queue} = $request->has_buffered_body | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | ? $request->body | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 239 | : ''; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 240 | 1 | $provider->{eof} = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | 1 | ▶ | $provider->{trailers} = $trailers if @$trailers; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 242 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 243 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | 8 | my $weak_self = $self; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | 8 | weaken($weak_self); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 246 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | 21 | ▶ | $body = sub { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=7.2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 248 | 21 | ▶ | my $self = $weak_self or return ('', 1); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | 21 | return $self->_provide_body($provider, @_); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | 8 | }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | elsif ($request->has_buffered_body) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | 2 | $body = $request->body; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 254 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 256 | my $stream_id = $native_message | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | ? $self->{session}->_submit_request_uniform_xs($native_message, $body) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | 37 | ▶ | : $self->{session}->_submit_request_xs($block, $body); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | 37 | my $transaction = Unblock::HTTP2::Transaction->_new( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | connection => $self, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 262 | stream_id => $stream_id, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 263 | request => $request, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 264 | callbacks => \%callbacks, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 265 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 266 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 267 | 37 | $self->_register_transaction($transaction); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 268 | 37 | $self->{receive}{$stream_id} = { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 269 | response => undef, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 270 | response_done => 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 271 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 272 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 273 | 37 | ▶ | if ($provider) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 274 | 8 | $provider->{stream_id} = $stream_id; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 275 | 8 | $self->{providers}{$stream_id} = $provider; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 276 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 277 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 278 | 37 | ▶ | $self->_transport_sync if $self->{transport_attached}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 279 | 37 | return $transaction; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 280 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 281 | 21 | ▶ | sub _provide_body { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_provide_body: called CC=14 SCAR=26.6
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 282 | 21 | my ($self, $provider, $stream_id, $max_length) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 283 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 284 | 21 | ▶ | if (!length($provider->{queue})) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 285 | 3 | ▶ | if ($provider->{eof}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 286 | 1 | ▶ | if ($provider->{trailers} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$provider->{"trailers"} and not $provider->{"trailer_submitted"}
MC/DC0%0/2
$provider->{"trailers"} and not $provider->{"trailer_submitted"}
$provider->{"trailers"}
not $provider->{"trailer_submitted"}
Truth table33%1/3
A and not(B)
A= $provider->{"trailers"}B= not $provider->{"trailer_submitted"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 287 | && !$provider->{trailer_submitted}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 288 | 0 | $self->_submit_provider_trailers($provider); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 289 | 0 | return ('', 1, 1); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 290 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 291 | 1 | return ('', 1); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 292 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 293 | 2 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 294 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 295 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 296 | my $take = length($provider->{queue}) < $max_length | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 297 | ? length($provider->{queue}) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 298 | 18 | ▶ | : $max_length; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 299 | 18 | my $chunk = substr($provider->{queue}, 0, $take, ''); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 300 | 18 | ▶ | my $eof = $provider->{eof} && !length($provider->{queue}) ? 1 : 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$provider->{"eof"} and not length $provider->{"queue"}
MC/DC100%2/2
$provider->{"eof"} and not length $provider->{"queue"}
$provider->{"eof"}
not length $provider->{"queue"}
Truth table100%3/3
A and not(B)
A= $provider->{"eof"}B= not length $provider->{"queue"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 301 | 18 | my $no_end_stream = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 302 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 303 | 18 | ▶ | if ($eof && $provider->{trailers} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition83%5/6
$eof and $provider->{"trailers"} and not $provider->{"trailer_submitted"}
$eof and $provider->{"trailers"}
MC/DC66%2/3
$eof and $provider->{"trailers"} and not $provider->{"trailer_submitted"}
$eof
$provider->{"trailers"}
not $provider->{"trailer_submitted"}
Truth table75%3/4
A and B and not(C)
A= $eofB= $provider->{"trailers"}C= not $provider->{"trailer_submitted"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 304 | && !$provider->{trailer_submitted}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 305 | 2 | $self->_submit_provider_trailers($provider); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 306 | 2 | $no_end_stream = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 307 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 308 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 309 | 18 | ▶ | if ($provider->{blocked} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$provider->{"blocked"} and length $provider->{"queue"} < $BODY_LOW_WATER
MC/DC100%2/2
$provider->{"blocked"} and length $provider->{"queue"} < $BODY_LOW_WATER
$provider->{"blocked"}
length $provider->{"queue"} < $BODY_LOW_WATER
Truth table100%3/3
A and B
A= $provider->{"blocked"}B= length $provider->{"queue"} < $BODY_LOW_WATER
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 310 | && length($provider->{queue}) < $BODY_LOW_WATER) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 311 | 2 | $provider->{blocked} = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 312 | 2 | $self->_queue_drain($provider->{stream_id}); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 313 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 314 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 315 | 18 | ▶ | return $no_end_stream | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 316 | ? ($chunk, $eof, 1) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 317 | : ($chunk, $eof); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 318 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 319 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 320 | 2 | ▶ | sub _submit_provider_trailers { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_submit_provider_trailers: called CC=3 SCAR=11.3
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 321 | 2 | my ($self, $provider) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 322 | 2 | ▶ | return if $provider->{trailer_submitted}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 323 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 324 | $self->{session}->submit_trailer( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 325 | $provider->{stream_id}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 326 | 2 | ▶ | headers => $provider->{trailers} || [], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$provider->{'trailers'} || []
MC/DC0%0/1
$provider->{'trailers'} || []
$provider->{'trailers'}
Truth table50%1/2
A
A= $provider->{'trailers'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 327 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 328 | 2 | $provider->{trailer_submitted} = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 329 | 2 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 330 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 331 | 30 | ▶ | sub _on_begin_headers { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_on_begin_headers: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 332 | 30 | return 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 333 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 334 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 335 | 1 | ▶ | sub _on_invalid_frame { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_on_invalid_frame: called CC=3 SCAR=11.4
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 336 | 1 | my ($self, $frame, $lib_error_code) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 337 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 338 | 1 | ▶ | my $copy = ref($frame) eq 'HASH' ? { %$frame } : {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 339 | 1 | ▶ | $self->_invoke_control_callback( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$lib_error_code || 0
MC/DC0%0/1
$lib_error_code || 0
$lib_error_code
Truth table50%1/2
A
A= $lib_error_code
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 340 | 'on_invalid_frame', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 341 | $copy, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 342 | 0 + ($lib_error_code || 0), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 343 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 344 | 1 | return 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 345 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 346 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 347 | 158 | ▶ | sub _on_frame_recv { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_on_frame_recv: called CC=32 SCAR=39.2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 348 | 158 | my ($self, $frame) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 349 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 350 | 158 | ▶ | return 0 if $self->_handle_settings_frame($frame); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 351 | 85 | ▶ | return 0 if $self->_handle_ping_frame($frame); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 352 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 353 | 82 | ▶ | if (($frame->{type} // -1) == H2_GOAWAY) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$frame->{"type"} // -1
MC/DC0%0/1
$frame->{"type"} // -1
$frame->{"type"}
Truth table50%1/2
A
A= $frame->{"type"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 354 | 3 | $self->{draining} = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 355 | $self->{peer_goaway} = { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 356 | last_stream_id => 0 + ($frame->{last_stream_id} // 0), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 357 | error_code => 0 + ($frame->{error_code} // 0), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 358 | debug_data => defined($frame->{debug_data}) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 359 | 3 | ▶ | ? "$frame->{debug_data}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%2/4
$frame->{"last_stream_id"} // 0
$frame->{"error_code"} // 0
MC/DC0%0/1
$frame->{"last_stream_id"} // 0
$frame->{"last_stream_id"}
MC/DC0%0/1
$frame->{"error_code"} // 0
$frame->{"error_code"}
Truth table50%1/2
A
A= $frame->{"last_stream_id"}
Truth table50%1/2
A
A= $frame->{"error_code"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 360 | : '', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 361 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 362 | 3 | return 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 363 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 364 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 365 | 79 | ▶ | my $stream_id = $frame->{stream_id} || 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$frame->{'stream_id'} || 0
MC/DC100%1/1
$frame->{'stream_id'} || 0
$frame->{'stream_id'}
Truth table100%2/2
A
A= $frame->{'stream_id'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 366 | 79 | ▶ | return 0 unless $stream_id; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 367 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 368 | 77 | ▶ | my $state = $self->{receive}{$stream_id} or return 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 369 | 76 | ▶ | my $transaction = $self->transaction_for_stream_id($stream_id) or return 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 370 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 371 | 76 | ▶ | if (($frame->{type} // -1) == H2_HEADERS) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$frame->{"type"} // -1
MC/DC0%0/1
$frame->{"type"} // -1
$frame->{"type"}
Truth table50%1/2
A
A= $frame->{"type"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 372 | 30 | ▶ | if (defined $frame->{header_error}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 373 | $self->_stream_failure( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 374 | $stream_id, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 375 | "$frame->{header_error}", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 376 | $frame->{header_error_code}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 377 | 0 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 378 | 0 | return 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 379 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 380 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 381 | 30 | ▶ | if (!$state->{response}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 382 | 28 | my $response = $frame->{uniform_message}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 383 | 28 | ▶ | if (!$response) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 384 | 0 | $self->_stream_failure( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 385 | $stream_id, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 386 | 'HTTP/2 response header block did not produce a Uniform response', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 387 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 388 | 0 | return 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 389 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 390 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 391 | 28 | my $status = $response->status; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 392 | 28 | ▶ | if ($status >= 100 && $status < 200) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$status >= 100 and $status < 200
MC/DC50%1/2
$status >= 100 and $status < 200
$status >= 100
$status < 200
Truth table66%2/3
A and B
A= $status >= 100B= $status < 200
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 393 | 3 | my $result = $transaction->_invoke( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 394 | 'on_informational', $response, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 395 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 396 | 3 | ▶ | $self->_stream_failure($stream_id, "$result") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 397 | unless $result eq '1'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 398 | 3 | return 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 399 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 400 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 401 | 25 | $state->{response} = $response; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 402 | 25 | $transaction->_set_response($response); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 403 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 404 | 25 | my $result = $transaction->_invoke('on_response', $response); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 405 | 25 | ▶ | if ($result ne '1') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 406 | 0 | $self->_stream_failure($stream_id, "$result"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 407 | 0 | return 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 408 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 409 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 410 | 25 | ▶ | if (($frame->{flags} || 0) & H2_END_STREAM) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$frame->{'flags'} || 0
MC/DC0%0/1
$frame->{'flags'} || 0
$frame->{'flags'}
Truth table50%1/2
A
A= $frame->{'flags'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 411 | 1 | $self->_finish_response($stream_id); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 412 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 413 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 414 | 25 | return 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 415 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 416 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 417 | 2 | ▶ | if ($frame->{uniform_message}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 418 | 0 | $self->_stream_failure( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 419 | $stream_id, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 420 | 'HTTP/2 trailing HEADERS must not contain :status', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 421 | H2_PROTOCOL_ERROR, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 422 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 423 | 0 | return 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 424 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 425 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 426 | 2 | ▶ | if (!(($frame->{flags} || 0) & H2_END_STREAM)) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$frame->{'flags'} || 0
MC/DC0%0/1
$frame->{'flags'} || 0
$frame->{'flags'}
Truth table50%1/2
A
A= $frame->{'flags'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 427 | 0 | $self->_stream_failure( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 428 | $stream_id, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 429 | 'HTTP/2 trailing HEADERS must end the stream', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 430 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 431 | 0 | return 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 432 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 433 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 434 | 2 | my $ok = eval { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 435 | Unblock::HTTP2::_Headers->apply_trailers( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 436 | $state->{response}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 437 | 2 | ▶ | $frame->{native_headers} || [], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$frame->{'native_headers'} || []
MC/DC0%0/1
$frame->{'native_headers'} || []
$frame->{'native_headers'}
Truth table50%1/2
A
A= $frame->{'native_headers'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 438 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 439 | 2 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 440 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 441 | 2 | ▶ | if (!$ok) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 442 | 0 | $self->_stream_failure($stream_id, "$@"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 443 | 0 | return 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 444 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 445 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 446 | 2 | $self->_finish_response($stream_id); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 447 | 2 | return 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 448 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 449 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 450 | 46 | ▶ | if (($frame->{type} // -1) == H2_DATA | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition85%6/7
($frame->{"type"} // -1) == 0 and ($frame->{"flags"} || 0) & 1
$frame->{"type"} // -1
$frame->{'flags'} || 0
MC/DC50%1/2
($frame->{"type"} // -1) == 0 and ($frame->{"flags"} || 0) & 1
$frame->{"type"}
$frame->{'flags'}
Truth table66%2/3
A and B
A= $frame->{"type"}B= $frame->{'flags'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 451 | && (($frame->{flags} || 0) & H2_END_STREAM)) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 452 | 21 | $self->_finish_response($stream_id); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 453 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 454 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 455 | 46 | return 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 456 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 457 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 458 | 35 | ▶ | sub _on_data_chunk_recv { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_on_data_chunk_recv: called CC=5 SCAR=17.6
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 459 | 35 | my ($self, $stream_id, $data, $flags) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 460 | 35 | ▶ | my $state = $self->{receive}{$stream_id} or return 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 461 | 34 | ▶ | my $transaction = $self->transaction_for_stream_id($stream_id) or return 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 462 | 34 | my $response = $state->{response}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 463 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 464 | 34 | ▶ | if (!$response) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 465 | 0 | $self->_stream_failure( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 466 | $stream_id, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 467 | 'HTTP/2 DATA arrived before final Response headers', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 468 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 469 | 0 | return 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 470 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 471 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 472 | 34 | $transaction->_receive_body_bytes(length $data); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 473 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 474 | 34 | my $result = $transaction->_invoke('on_body', $response, $data); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 475 | 34 | ▶ | if ($result ne '1') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 476 | 0 | $self->_stream_failure($stream_id, "$result"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 477 | 0 | return 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 478 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 479 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 480 | 34 | $transaction->_auto_consume_body; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 481 | 34 | return 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 482 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 483 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 484 | 24 | ▶ | sub _finish_response { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_finish_response: called CC=6 SCAR=19.7
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 485 | 24 | my ($self, $stream_id) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 486 | 24 | ▶ | my $state = $self->{receive}{$stream_id} or return; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 487 | 24 | ▶ | return if $state->{response_done}++; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 488 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 489 | 24 | ▶ | my $transaction = $self->transaction_for_stream_id($stream_id) or return; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 490 | 24 | my $response = $state->{response}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 491 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 492 | 24 | ▶ | if (!$response) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 493 | 0 | $self->_stream_failure( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 494 | $stream_id, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 495 | 'HTTP/2 stream ended before final Response headers', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 496 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 497 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 498 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 499 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 500 | 24 | $response->mark_complete->freeze; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 501 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 502 | 24 | my $result = $transaction->_invoke('on_complete'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 503 | 24 | ▶ | $self->_invoke_stream_error($transaction, "$result") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 504 | unless $result eq '1'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 505 | 24 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 506 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 507 | 30 | ▶ | sub _on_stream_close { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_on_stream_close: called CC=8 SCAR=21.5
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 508 | 30 | my ($self, $stream_id, $error_code) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 509 | 30 | my $state = delete $self->{receive}{$stream_id}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 510 | 30 | delete $self->{providers}{$stream_id}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 511 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 512 | 30 | ▶ | my $transaction = $self->_remove_transaction($stream_id) or return 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 513 | 30 | ▶ | return 0 if $transaction->is_terminal; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 514 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 515 | 28 | ▶ | if ($error_code) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 516 | 3 | my $error = "HTTP/2 stream closed with error $error_code"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 517 | 3 | $transaction->_fail($error, $error_code, 1); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 518 | 3 | $self->_invoke_stream_error($transaction, $error, $error_code); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 519 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 520 | ▶ | elsif ($state && $state->{response}) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$state and $state->{"response"}
MC/DC50%1/2
$state and $state->{"response"}
$state
$state->{"response"}
Truth table66%2/3
A and B
A= $stateB= $state->{"response"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 521 | 24 | $state->{response}->mark_complete->freeze; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 522 | 24 | ▶ | if (!$state->{response_done}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 523 | 0 | my $result = $transaction->_invoke('on_complete'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 524 | 0 | ▶ | $self->_invoke_stream_error($transaction, "$result") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 525 | unless $result eq '1'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 526 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 527 | 24 | $transaction->_mark_complete; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 528 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 529 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 530 | 1 | my $error = 'HTTP/2 stream closed before final Response'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 531 | 1 | $transaction->_fail($error); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 532 | 1 | $self->_invoke_stream_error($transaction, $error); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 533 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 534 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 535 | 28 | return 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 536 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 537 | 0 | ▶ | sub _stream_failure { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_stream_failure: not called CC=6 SCAR=37.4
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 538 | 0 | my ($self, $stream_id, $error, $code) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 539 | 0 | ▶ | $code = H2_INTERNAL_ERROR unless defined $code; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 540 | 0 | ▶ | $error = 'HTTP/2 stream failure' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $error and length $error
MC/DC0%0/2
defined $error and length $error
defined $error
length $error
Truth table0%0/3
A and B
A= defined $errorB= length $error
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 541 | unless defined($error) && length($error); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 542 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 543 | 0 | ▶ | my $transaction = $self->transaction_for_stream_id($stream_id) or return; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 544 | 0 | ▶ | return if $transaction->is_terminal; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 545 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 546 | 0 | $transaction->_fail($error, $code, 0); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 547 | 0 | eval { $self->{session}->submit_rst_stream($stream_id, $code) }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 548 | 0 | $self->_invoke_stream_error($transaction, $error, $code); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 549 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 550 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 551 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 552 | 12 | ▶ | sub _write_stream_body { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_write_stream_body: called CC=10 SCAR=23.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 553 | 12 | my ($self, $transaction, $bytes, $final, $operation) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 554 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 555 | 12 | ▶ | my $provider = $self->{providers}{ $transaction->stream_id } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 556 | or croak "$operation(): Transaction has no streaming Request body"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 557 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 558 | 12 | $bytes = $self->_body_bytes("$operation()", $bytes); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 559 | croak "$operation(): streaming Request body is already complete" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 560 | 12 | ▶ | if $provider->{eof}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 561 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 562 | 12 | $provider->{queue} .= $bytes; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 563 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 564 | 12 | ▶ | if ($final) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 565 | 6 | my $trailers = Unblock::HTTP2::_Headers->trailer_fields( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 566 | "$operation()", $transaction->request, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 567 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 568 | 6 | ▶ | $provider->{trailers} = $trailers if @$trailers; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 569 | 6 | $provider->{eof} = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 570 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 571 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 572 | 12 | ▶ | if ($self->{session}->is_stream_deferred($transaction->stream_id)) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 573 | 1 | $self->{session}->resume_stream($transaction->stream_id); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 574 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 575 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 576 | 12 | my $blocked = length($provider->{queue}) >= $BODY_HIGH_WATER; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 577 | 12 | ▶ | $provider->{blocked} = 1 if $blocked; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 578 | 12 | ▶ | $self->_transport_sync if $self->{transport_attached}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 579 | 12 | ▶ | if ($self->{transport_blocked}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 580 | 1 | $provider->{blocked} = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 581 | 1 | return 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 582 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 583 | 11 | ▶ | return $blocked ? 0 : 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 584 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 585 | 0 | ▶ | sub _send_informational_stream { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_send_informational_stream: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 586 | 0 | croak 'send_informational(): client-side streams cannot send Responses'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 587 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 588 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 589 | 0 | ▶ | sub _respond_stream { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_respond_stream: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 590 | 0 | croak 'respond(): client-side streams cannot send Responses'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 591 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 592 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 593 | 0 | ▶ | sub _cancel_stream { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_cancel_stream: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 594 | 0 | my ($self, $transaction) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 595 | 0 | ▶ | return if $transaction->is_terminal; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 596 | 0 | $self->_reset_stream($transaction, H2_CANCEL); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 597 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 598 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 599 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 600 | 8 | ▶ | sub close { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
close: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 601 | 8 | my ($self, @args) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 602 | 8 | $self->SUPER::close(@args); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 603 | 8 | $self->{receive} = {}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 604 | 8 | $self->{providers} = {}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 605 | 8 | return $self; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 606 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 607 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 608 | 28 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 609 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 610 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||