line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Protocol::HTTP2::Frame::Goaway; |
2
|
11
|
|
|
11
|
|
54
|
use strict; |
|
11
|
|
|
|
|
18
|
|
|
11
|
|
|
|
|
270
|
|
3
|
11
|
|
|
11
|
|
55
|
use warnings; |
|
11
|
|
|
|
|
15
|
|
|
11
|
|
|
|
|
308
|
|
4
|
11
|
|
|
11
|
|
54
|
use Protocol::HTTP2::Constants qw(const_name :flags :errors); |
|
11
|
|
|
|
|
15
|
|
|
11
|
|
|
|
|
2523
|
|
5
|
11
|
|
|
11
|
|
63
|
use Protocol::HTTP2::Trace qw(tracer bin2hex); |
|
11
|
|
|
|
|
21
|
|
|
11
|
|
|
|
|
3781
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub decode { |
8
|
6
|
|
|
6
|
0
|
1347
|
my ( $con, $buf_ref, $buf_offset, $length ) = @_; |
9
|
6
|
|
|
|
|
1380
|
my $frame_ref = $con->decode_context->{frame}; |
10
|
|
|
|
|
|
|
|
11
|
6
|
50
|
|
|
|
1387
|
if ( $frame_ref->{stream} != 0 ) { |
12
|
0
|
|
|
|
|
0
|
$con->error(PROTOCOL_ERROR); |
13
|
0
|
|
|
|
|
0
|
return undef; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
6
|
|
|
|
|
1388
|
my ( $last_stream_id, $error_code ) = |
17
|
|
|
|
|
|
|
unpack( 'N2', substr( $$buf_ref, $buf_offset, 8 ) ); |
18
|
|
|
|
|
|
|
|
19
|
6
|
|
|
|
|
1346
|
$last_stream_id &= 0x7FFF_FFFF; |
20
|
|
|
|
|
|
|
|
21
|
6
|
|
|
|
|
1393
|
tracer->debug( "GOAWAY with error code " |
22
|
|
|
|
|
|
|
. const_name( 'errors', $error_code ) |
23
|
|
|
|
|
|
|
. " last stream is $last_stream_id\n" ); |
24
|
|
|
|
|
|
|
|
25
|
6
|
50
|
|
|
|
1355
|
tracer->debug( "additional debug data: " |
26
|
|
|
|
|
|
|
. bin2hex( substr( $$buf_ref, $buf_offset + 8 ) ) |
27
|
|
|
|
|
|
|
. "\n" ) |
28
|
|
|
|
|
|
|
if $length - 8 > 0; |
29
|
|
|
|
|
|
|
|
30
|
6
|
|
|
|
|
1391
|
$con->goaway(1); |
31
|
|
|
|
|
|
|
|
32
|
6
|
|
|
|
|
2743
|
return $length; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub encode { |
36
|
8
|
|
|
8
|
0
|
1685
|
my ( $con, $flags_ref, $stream, $data ) = @_; |
37
|
|
|
|
|
|
|
|
38
|
8
|
|
|
|
|
1440
|
$con->goaway(1); |
39
|
|
|
|
|
|
|
|
40
|
8
|
|
|
|
|
1407
|
my $payload = pack( 'N2', @$data ); |
41
|
8
|
|
|
|
|
1415
|
tracer->debug( "\tGOAWAY: last stream = $data->[0], error = " |
42
|
|
|
|
|
|
|
. const_name( "errors", $data->[1] ) |
43
|
|
|
|
|
|
|
. "\n" ); |
44
|
8
|
50
|
|
|
|
1393
|
$payload .= $data->[2] if @$data > 2; |
45
|
8
|
|
|
|
|
2732
|
return $payload; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |