| 1 | package Unblock::HTTP::_WebSocketH2Body; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use Carp qw(croak); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use Scalar::Util qw(blessed weaken); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | # Stream-specific adapter for HTTP2/HTTP3. WebSocket output is accepted | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | # into a bounded producer queue and flushed only after protocol callbacks | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | # unwind. The framework must schedule defer() on a later loop turn. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 4 | ▶ | sub new { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=6 SCAR=19.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 4 | my ($class, %option) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 4 | my $tx = delete $option{transaction}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 4 | my $defer = delete $option{defer}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 4 | ▶ | croak 'H2 WebSocket bridge requires a streaming Transaction' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
builtin::blessed($tx) and $tx->can("write") and $tx->can("end")
builtin::blessed($tx) and $tx->can("write")
MC/DC0%0/3
builtin::blessed($tx) and $tx->can("write") and $tx->can("end")
builtin::blessed($tx)
$tx->can("write")
$tx->can("end")
Truth table25%1/4
A and B and C
A= builtin::blessed($tx)B= $tx->can("write")C= $tx->can("end")
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | unless blessed($tx) && $tx->can('write') && $tx->can('end'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 4 | ▶ | croak 'H2 WebSocket bridge requires a defer callback' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | unless ref($defer) eq 'CODE'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 4 | ▶ | croak 'H2 WebSocket bridge unknown options' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | if %option; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 4 | my $self = bless { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | transaction => $tx, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | defer => $defer, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | queue => [], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | queued => 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | scheduled => 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | waiting => 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | ending => 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | ended => 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | aborted => undef, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | detached => 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | }, $class; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | 4 | weaken($self->{transaction}); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | 4 | return $self; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 0 | ▶ | sub websocket { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
websocket: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 0 | my ($self, $ws) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | 0 | $self->{websocket} = $ws; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 0 | weaken($self->{websocket}); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 0 | return $self; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | # Whole-buffer acceptance. Return false after acceptance to backpressure | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | # the WebSocket producer. A single frame may exceed the high-water mark. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | 6 | ▶ | sub unblock_send { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
unblock_send: called CC=8 SCAR=23.7
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 6 | my ($self, $bytes) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | croak 'H2 WebSocket body is no longer writable' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | 6 | ▶ | if $self->{detached} || $self->{ending} || defined($self->{aborted}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
$self->{"detached"} or $self->{"ending"} or defined $self->{"aborted"}
$self->{"detached"} or $self->{"ending"}
MC/DC0%0/3
$self->{"detached"} or $self->{"ending"} or defined $self->{"aborted"}
$self->{"detached"}
$self->{"ending"}
defined $self->{"aborted"}
Truth table25%1/4
A or B or C
A= $self->{"detached"}B= $self->{"ending"}C= defined $self->{"aborted"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | 6 | ▶ | croak 'H2 WebSocket body requires byte strings' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
not defined $bytes or ref $bytes
MC/DC0%0/2
not defined $bytes or ref $bytes
not defined $bytes
ref $bytes
Truth table33%1/3
not(A) or B
A= not defined $bytesB= ref $bytes
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | if !defined($bytes) || ref($bytes); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | 6 | ▶ | if (length $bytes) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | 6 | push @{ $self->{queue} }, "$bytes"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | 6 | $self->{queued} += length $bytes; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 6 | $self->_schedule; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | 6 | ▶ | return $self->{queued} < 65_536 ? 1 : 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 1 | ▶ | sub unblock_finish { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
unblock_finish: called CC=3 SCAR=11.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | 1 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | 1 | ▶ | return if $self->{detached} || $self->{ending}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$self->{"detached"} or $self->{"ending"}
MC/DC0%0/2
$self->{"detached"} or $self->{"ending"}
$self->{"detached"}
$self->{"ending"}
Truth table33%1/3
A or B
A= $self->{"detached"}B= $self->{"ending"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | 1 | $self->{ending} = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | 1 | $self->_schedule; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | 1 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | 2 | ▶ | sub unblock_abort { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
unblock_abort: called CC=4 SCAR=14.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | 2 | my ($self, $reason) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | 2 | ▶ | return if $self->{detached} || defined($self->{aborted}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$self->{"detached"} or defined $self->{"aborted"}
MC/DC50%1/2
$self->{"detached"} or defined $self->{"aborted"}
$self->{"detached"}
defined $self->{"aborted"}
Truth table66%2/3
A or B
A= $self->{"detached"}B= defined $self->{"aborted"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | 1 | ▶ | $self->{aborted} = defined($reason) ? "$reason" : 'WebSocket failed'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | 1 | $self->{queue} = []; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | 1 | $self->{queued} = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | 1 | $self->_schedule; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | 1 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | 2 | ▶ | sub resume { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
resume: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | 2 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | 2 | ▶ | return if $self->{detached}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | 2 | $self->{waiting} = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | 2 | $self->_schedule; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | 2 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | 2 | ▶ | sub detach { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
detach: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | 2 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | 2 | $self->{detached} = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | 2 | $self->{queue} = []; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 2 | $self->{queued} = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | 2 | delete $self->{transaction}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | 2 | delete $self->{websocket}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | 2 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | 10 | ▶ | sub _schedule { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_schedule: called CC=4 SCAR=14.2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | 10 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | 10 | ▶ | return if $self->{detached} || $self->{scheduled}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$self->{"detached"} or $self->{"scheduled"}
MC/DC50%1/2
$self->{"detached"} or $self->{"scheduled"}
$self->{"detached"}
$self->{"scheduled"}
Truth table66%2/3
A or B
A= $self->{"detached"}B= $self->{"scheduled"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | 7 | $self->{scheduled} = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | 7 | my $ok = eval { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 7 | ▶ | $self->{defer}->(sub { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | 7 | $self->{scheduled} = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | 7 | $self->_flush; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | 7 | }); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | 7 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | 7 | ▶ | unless ($ok) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | 0 | $self->{scheduled} = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | 0 | die $@; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | 7 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | 7 | ▶ | sub _flush { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_flush: called CC=16 SCAR=28.2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | 7 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | 7 | ▶ | return if $self->{detached}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | 7 | my $tx = $self->{transaction}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | 7 | ▶ | return $self->detach unless $tx && !$tx->is_terminal; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$tx and not $tx->is_terminal
MC/DC0%0/2
$tx and not $tx->is_terminal
$tx
not $tx->is_terminal
Truth table33%1/3
A and not(B)
A= $txB= not $tx->is_terminal
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | 7 | ▶ | if (defined($self->{aborted})) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | 1 | $tx->cancel; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | 1 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | 6 | ▶ | return if $self->{waiting}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | 5 | ▶ | while (@{ $self->{queue} }) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | 5 | my $bytes = shift @{ $self->{queue} }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | 5 | $self->{queued} -= length $bytes; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | # A false write return means the full buffer was accepted into H2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | # but the producer must wait for on_drain before further writes. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | 5 | my $ready = $tx->write($bytes); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | 5 | ▶ | unless ($ready) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | 1 | $self->{waiting} = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | 1 | last; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | 5 | ▶ | if (!$self->{waiting} && !@{ $self->{queue} } && $self->{ending} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition88%8/9
not $self->{"waiting"} || @{$self->{"queue"};} and $self->{"ending"} and not $self->{"ended"}
not $self->{"waiting"} || @{$self->{"queue"};} and $self->{"ending"}
$self->{'waiting'} || @{$self->{'queue'};}
MC/DC75%3/4
not $self->{"waiting"} || @{$self->{"queue"};} and $self->{"ending"} and not $self->{"ended"}
$self->{'waiting'}
@{$self->{'queue'};}
$self->{"ending"}
not $self->{"ended"}
Truth table80%4/5
not(A || B) and C and not(D)
A= $self->{'waiting'}B= @{$self->{'queue'};}C= $self->{"ending"}D= not $self->{"ended"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | && !$self->{ended}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | 1 | $self->{ended} = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | 1 | $tx->end; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | 5 | ▶ | if (!$self->{waiting} && $self->{queued} < 32_768) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
not $self->{"waiting"} and $self->{"queued"} < 32768
MC/DC50%1/2
not $self->{"waiting"} and $self->{"queued"} < 32768
not $self->{"waiting"}
$self->{"queued"} < 32768
Truth table66%2/3
not(A) and B
A= not $self->{"waiting"}B= $self->{"queued"} < 32768
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | 4 | my $ws = $self->{websocket}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | 4 | ▶ | $ws->resume_output if $ws && !$ws->is_closed; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$ws and not $ws->is_closed
MC/DC0%0/2
$ws and not $ws->is_closed
$ws
not $ws->is_closed
Truth table33%1/3
A and not(B)
A= $wsB= not $ws->is_closed
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | 5 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||