| 1 | package Linux::Event::HTTP::_UpgradedStream; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | 2 | ▶ | use v5.36; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 3 | 2 | ▶ | use parent 'Linux::Event::HTTP::_Transport'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||||||||||
| 5 | # The socket, TLS state and ordered write queue survive transition_to(). | ||||||||||||||||||||||||||||||||||||||||||
| 6 | # The successor is the only protocol input owner after HTTP1 Upgrade. | ||||||||||||||||||||||||||||||||||||||||||
| 7 | 5 | ▶ | sub on_data ($self, $bytes) { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
on_data: called CC=4 SCAR=16.6
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 8 | 5 | ▶ | my $successor = $self->{http_successor} or return; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 9 | 5 | my $ok = eval { $successor->input($bytes); 1 }; | |||||||||||||||||||||||||||||||||||||||||
| 10 | 5 | ▶ | unless ($ok) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 11 | 0 | $successor->transport_error("$@"); | |||||||||||||||||||||||||||||||||||||||||
| 12 | 0 | ▶ | $self->close unless $self->is_closed; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 13 | } | ||||||||||||||||||||||||||||||||||||||||||
| 14 | 5 | return; | |||||||||||||||||||||||||||||||||||||||||
| 15 | } | ||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||
| 17 | 2 | ▶ | sub on_eof ($self) { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
on_eof: called CC=4 SCAR=17.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 18 | 2 | my $successor = $self->{http_successor}; | |||||||||||||||||||||||||||||||||||||||||
| 19 | 2 | ▶ | $successor->input_eof | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
$successor and !$successor->can("want_read") || $successor->want_read
not $successor->can("want_read") or $successor->want_read
MC/DC0%0/3
$successor and !$successor->can("want_read") || $successor->want_read
$successor
not $successor->can("want_read")
$successor->want_read
Truth table25%1/4
A and not(B) or C
A= $successorB= not $successor->can("want_read")C= $successor->want_read
| |||||||||||||||||||||||||||||||||||||||||||
| 20 | if $successor && (!$successor->can('want_read') || $successor->want_read); | ||||||||||||||||||||||||||||||||||||||||||
| 21 | 2 | return; | |||||||||||||||||||||||||||||||||||||||||
| 22 | } | ||||||||||||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||||||||||||
| 24 | 0 | ▶ | sub on_drain ($self) { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
on_drain: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 25 | 0 | $self->{http_output_blocked} = 0; | |||||||||||||||||||||||||||||||||||||||||
| 26 | 0 | my $successor = $self->{http_successor}; | |||||||||||||||||||||||||||||||||||||||||
| 27 | 0 | ▶ | $successor->resume_output if $successor; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 28 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||||||||||||||
| 31 | 0 | ▶ | sub on_error ($self, $error) { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
on_error: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 32 | 0 | my $successor = $self->{http_successor}; | |||||||||||||||||||||||||||||||||||||||||
| 33 | 0 | ▶ | $successor->transport_error("$error") if $successor; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 34 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||
| 37 | 4 | ▶ | sub on_close ($self) { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
on_close: called CC=5 SCAR=17.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 38 | 4 | my $successor = delete $self->{http_successor}; | |||||||||||||||||||||||||||||||||||||||||
| 39 | 4 | ▶ | $successor->transport_error('Upgraded transport closed') | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
$successor and not $successor->can("is_closed") && $successor->is_closed
$successor->can('is_closed') && $successor->is_closed
MC/DC0%0/3
$successor and not $successor->can("is_closed") && $successor->is_closed
$successor
$successor->can('is_closed')
$successor->is_closed
Truth table25%1/4
A and not(B && C)
A= $successorB= $successor->can('is_closed')C= $successor->is_closed
| |||||||||||||||||||||||||||||||||||||||||||
| 40 | if $successor && (!$successor->can('is_closed') || !$successor->is_closed); | ||||||||||||||||||||||||||||||||||||||||||
| 41 | 4 | ▶ | if (my $server = $self->data->{server}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 42 | 3 | $server->_closed($self); | |||||||||||||||||||||||||||||||||||||||||
| 43 | } | ||||||||||||||||||||||||||||||||||||||||||
| 44 | 4 | return; | |||||||||||||||||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||||||||||||||
| 47 | 2 | 1; | |||||||||||||||||||||||||||||||||||||||||