| 1 | package Protocol::HTTP2::Frame::Window_update; | ||||||||||||||||||||||||||||||||
| 2 | 13 | ▶ | use strict; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 3 | 13 | ▶ | use warnings; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 4 | 13 | ▶ | use Protocol::HTTP2::Constants qw(:flags :errors :limits); | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 5 | 13 | ▶ | use Protocol::HTTP2::Trace qw(tracer); | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||
| 7 | 1 | ▶ | sub decode { | ||||||||||||||||||||||||||||||
|
Subroutine
decode: called CC=8 SCAR=31.5
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 8 | 1 | my ( $con, $buf_ref, $buf_offset, $length ) = @_; | |||||||||||||||||||||||||||||||
| 9 | 1 | my $frame_ref = $con->decode_context->{frame}; | |||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||
| 11 | 1 | ▶ | if ( $length != 4 ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 12 | 0 | tracer->error( | |||||||||||||||||||||||||||||||
| 13 | "Received windows_update frame with invalid length $length"); | ||||||||||||||||||||||||||||||||
| 14 | 0 | $con->error(FRAME_SIZE_ERROR); | |||||||||||||||||||||||||||||||
| 15 | 0 | return undef; | |||||||||||||||||||||||||||||||
| 16 | } | ||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||
| 18 | 1 | my $fcw_add = unpack 'N', substr $$buf_ref, $buf_offset, 4; | |||||||||||||||||||||||||||||||
| 19 | 1 | $fcw_add &= 0x7FFF_FFFF; | |||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||
| 21 | 1 | ▶ | if ( $fcw_add == 0 ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 22 | 0 | tracer->error("Received flow-control window increment of 0"); | |||||||||||||||||||||||||||||||
| 23 | 0 | $con->error(PROTOCOL_ERROR); | |||||||||||||||||||||||||||||||
| 24 | 0 | return undef; | |||||||||||||||||||||||||||||||
| 25 | } | ||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||
| 27 | 1 | ▶ | if ( $frame_ref->{stream} == 0 ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 28 | 1 | ▶ | if ( $con->fcw_send($fcw_add) > MAX_FCW_SIZE ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 29 | 0 | $con->error(FLOW_CONTROL_ERROR); | |||||||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||||||
| 31 | else { | ||||||||||||||||||||||||||||||||
| 32 | 1 | $con->send_blocked(); | |||||||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||||||
| 35 | else { | ||||||||||||||||||||||||||||||||
| 36 | 0 | my $fcw = $con->stream_fcw_send( $frame_ref->{stream}, $fcw_add ); | |||||||||||||||||||||||||||||||
| 37 | 0 | ▶ | if ( defined $fcw && $fcw > MAX_FCW_SIZE ) { | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition0%0/3
defined $fcw and $fcw > 2147483647
MC/DC0%0/2
defined $fcw and $fcw > 2147483647
defined $fcw
$fcw > 2147483647
Truth table0%0/3
A and B
A= defined $fcwB= $fcw > 2147483647
| |||||||||||||||||||||||||||||||||
| 38 | 0 | tracer->warning("flow-control window size exceeded MAX_FCW_SIZE"); | |||||||||||||||||||||||||||||||
| 39 | 0 | $con->stream_error( $frame_ref->{stream}, FLOW_CONTROL_ERROR ); | |||||||||||||||||||||||||||||||
| 40 | } | ||||||||||||||||||||||||||||||||
| 41 | elsif ( defined $fcw ) { | ||||||||||||||||||||||||||||||||
| 42 | 0 | $con->stream_send_blocked( $frame_ref->{stream} ); | |||||||||||||||||||||||||||||||
| 43 | } | ||||||||||||||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||||||||||||
| 45 | 1 | return $length; | |||||||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||||||
| 48 | 1 | ▶ | sub encode { | ||||||||||||||||||||||||||||||
|
Subroutine
encode: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 49 | 1 | my ( $con, $flags_ref, $stream, $data ) = @_; | |||||||||||||||||||||||||||||||
| 50 | 1 | return pack 'N', $data; | |||||||||||||||||||||||||||||||
| 51 | } | ||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||
| 53 | 13 | 1; | |||||||||||||||||||||||||||||||