| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Protocol::SPDY::Frame::Control::HEADERS; |
|
2
|
|
|
|
|
|
|
{ |
|
3
|
|
|
|
|
|
|
$Protocol::SPDY::Frame::Control::HEADERS::VERSION = '1.000'; |
|
4
|
|
|
|
|
|
|
} |
|
5
|
3
|
|
|
3
|
|
17
|
use strict; |
|
|
3
|
|
|
|
|
5
|
|
|
|
3
|
|
|
|
|
106
|
|
|
6
|
3
|
|
|
3
|
|
16
|
use warnings; |
|
|
3
|
|
|
|
|
3
|
|
|
|
3
|
|
|
|
|
95
|
|
|
7
|
3
|
|
|
3
|
|
14
|
use parent qw(Protocol::SPDY::Frame::HeaderSupport Protocol::SPDY::Frame::Control); |
|
|
3
|
|
|
|
|
6
|
|
|
|
3
|
|
|
|
|
16
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 NAME |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
Protocol::SPDY::Frame::Control::HEADERS - header update packet |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 VERSION |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
version 1.000 |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
See L and L. |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=cut |
|
24
|
|
|
|
|
|
|
|
|
25
|
3
|
|
|
3
|
|
250
|
use Compress::Raw::Zlib qw(Z_OK WANT_GZIP_OR_ZLIB adler32); |
|
|
3
|
|
|
|
|
4
|
|
|
|
3
|
|
|
|
|
215
|
|
|
26
|
|
|
|
|
|
|
|
|
27
|
3
|
|
|
3
|
|
15
|
use Protocol::SPDY::Constants ':all'; |
|
|
3
|
|
|
|
|
6
|
|
|
|
3
|
|
|
|
|
1942
|
|
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head2 type_name |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
The string type for this frame ('HEADERS'). |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=cut |
|
34
|
|
|
|
|
|
|
|
|
35
|
12
|
|
|
12
|
1
|
55
|
sub type_name { 'HEADERS' } |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head2 new |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
Instantiate. |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=cut |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub new { |
|
44
|
4
|
|
|
4
|
1
|
6
|
my $class = shift; |
|
45
|
4
|
|
|
|
|
22
|
my %args = @_; |
|
46
|
4
|
50
|
50
|
|
|
18
|
$args{headers} = $class->header_hashref_to_arrayref($args{headers}) if (ref($args{headers}) || '') eq 'HASH'; |
|
47
|
4
|
|
|
|
|
33
|
$class->SUPER::new(%args) |
|
48
|
|
|
|
|
|
|
} |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head2 from_data |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
Instantiate from the given data. |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=cut |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub from_data { |
|
57
|
2
|
|
|
2
|
1
|
4
|
my $class = shift; |
|
58
|
2
|
|
|
|
|
7
|
my %args = @_; |
|
59
|
2
|
|
|
|
|
8
|
my ($stream_id) = unpack "N1", substr $args{data}, 0, 4, ''; |
|
60
|
2
|
|
|
|
|
3
|
$stream_id &= ~0x80000000; |
|
61
|
|
|
|
|
|
|
|
|
62
|
2
|
|
|
|
|
4
|
my $zlib = delete $args{zlib}; |
|
63
|
2
|
|
|
|
|
8
|
my $out = $zlib->decompress($args{data}); |
|
64
|
2
|
|
|
|
|
17
|
my ($headers) = $class->extract_headers($out); |
|
65
|
2
|
|
|
|
|
11
|
$class->new( |
|
66
|
|
|
|
|
|
|
%args, |
|
67
|
|
|
|
|
|
|
stream_id => $stream_id, |
|
68
|
|
|
|
|
|
|
headers => $headers, |
|
69
|
|
|
|
|
|
|
); |
|
70
|
|
|
|
|
|
|
} |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=head2 stream_id |
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
Which stream this frame applies to. |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=cut |
|
77
|
|
|
|
|
|
|
|
|
78
|
4
|
|
|
4
|
1
|
15
|
sub stream_id { shift->{stream_id} } |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head2 as_packet |
|
81
|
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
Byte representation for this packet. |
|
83
|
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=cut |
|
85
|
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
sub as_packet { |
|
87
|
2
|
|
|
2
|
1
|
4
|
my $self = shift; |
|
88
|
2
|
|
|
|
|
4
|
my $zlib = shift; |
|
89
|
2
|
|
|
|
|
9
|
my $payload = pack 'N1', $self->stream_id & 0x7FFFFFFF; |
|
90
|
2
|
|
|
|
|
4
|
my $block = $self->pairs_to_nv_header(map {; $_->[0], join "\0", @{$_}[1..$#$_] } @{$self->headers}); |
|
|
2
|
|
|
|
|
8
|
|
|
|
2
|
|
|
|
|
20
|
|
|
|
2
|
|
|
|
|
14
|
|
|
91
|
2
|
|
|
|
|
9
|
$payload .= $zlib->compress($block); |
|
92
|
2
|
|
|
|
|
20
|
return $self->SUPER::as_packet( |
|
93
|
|
|
|
|
|
|
payload => $payload, |
|
94
|
|
|
|
|
|
|
); |
|
95
|
|
|
|
|
|
|
} |
|
96
|
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head2 to_string |
|
98
|
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
String representation, for debugging. |
|
100
|
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=cut |
|
102
|
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
sub to_string { |
|
104
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
|
105
|
0
|
|
|
|
|
|
$self->SUPER::to_string . ', id=' . $self->stream_id . ', ' . $self->header_line; |
|
106
|
|
|
|
|
|
|
} |
|
107
|
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
1; |
|
109
|
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
__END__ |