| 1 | package Linux::Event::HTTP::_Config; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | 20 | ▶ | use v5.36; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 20 | ▶ | use Unblock::HTTP 0.03 (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 20 | ▶ | use Unblock::HTTP1 0.13 (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 20 | ▶ | use Carp qw(croak); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 20 | ▶ | use Scalar::Util qw(blessed); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 34 | ▶ | sub loop ($loop) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
loop: called CC=3 SCAR=14.2
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 34 | ▶ | croak 'new(): loop must be a Linux::Event::Loop' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
builtin::blessed($loop) and $loop->isa("Linux::Event::Loop")
MC/DC0%0/2
builtin::blessed($loop) and $loop->isa("Linux::Event::Loop")
builtin::blessed($loop)
$loop->isa("Linux::Event::Loop")
Truth table33%1/3
A and B
A= builtin::blessed($loop)B= $loop->isa("Linux::Event::Loop")
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | unless blessed($loop) && $loop->isa('Linux::Event::Loop'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 34 | ▶ | sub stream_class ($option) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
stream_class: called CC=6 SCAR=20.3
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 34 | ▶ | my $native = exists($option->{native_input}) ? delete($option->{native_input}) : 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 34 | ▶ | croak 'new(): native_input must be 0 or 1' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
defined $native and not ref $native and $native =~ /\A[01]\z/u
defined $native and not ref $native
MC/DC0%0/3
defined $native and not ref $native and $native =~ /\A[01]\z/u
defined $native
not ref $native
$native =~ /\A[01]\z/u
Truth table25%1/4
A and not(B) and C
A= defined $nativeB= not ref $nativeC= $native =~ /\A[01]\z/u
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | unless defined($native) && !ref($native) && $native =~ /\A[01]\z/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 34 | ▶ | return 'Linux::Event::HTTP::_Stream' unless $native; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 34 | require Linux::Event::HTTP::_NativeStream; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 34 | return 'Linux::Event::HTTP::_NativeStream'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 34 | ▶ | sub protocols ($option) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
protocols: called CC=15 SCAR=35.7
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 34 | my %protocols; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 34 | for my $name (qw(http1 http2 http3)) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 102 | ▶ | my $value = exists($option->{$name}) ? delete($option->{$name}) : ($name eq 'http1' ? 1 : 0); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 102 | ▶ | croak "new(): $name must be 0, 1 or a hash reference" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition44%4/9
ref $value eq "HASH" or defined $value and not ref $value and $value =~ /\A[01]\z/u
defined $value and not ref $value and $value =~ /\A[01]\z/u
defined $value and not ref $value
MC/DC0%0/4
ref $value eq "HASH" or defined $value and not ref $value and $value =~ /\A[01]\z/u
ref $value eq "HASH"
defined $value
not ref $value
$value =~ /\A[01]\z/u
Truth table40%2/5
A or B and not(C) and D
A= ref $value eq "HASH"B= defined $valueC= not ref $valueD= $value =~ /\A[01]\z/u
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | unless ref($value) eq 'HASH' || (defined($value) && !ref($value) && $value =~ /\A[01]\z/); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 102 | ▶ | next unless ref($value) || $value; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
ref $value or $value
MC/DC100%2/2
ref $value or $value
ref $value
$value
Truth table100%3/3
A or B
A= ref $valueB= $value
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 34 | ▶ | if ($name eq 'http3') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 0 | ▶ | eval { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 0 | require Unblock::HTTP3; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 0 | Unblock::HTTP3->VERSION('0.14'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | 0 | require Net::QUIC; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | 0 | Net::QUIC->VERSION('0.06'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 0 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | } or croak "new(): http3 requires Unblock::HTTP3 >= 0.14 and Net::QUIC >= 0.06: $@"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 34 | ▶ | if ($name eq 'http2') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | 0 | ▶ | eval { require Unblock::HTTP2; Unblock::HTTP2->VERSION('0.13'); 1 } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | or croak "new(): http2 requires Unblock::HTTP2 >= 0.13: $@"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 34 | ▶ | $protocols{$name} = ref($value) ? $value : {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | 34 | return %protocols; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 20 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||