| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Protocol::SPDY::Frame::Control::SYN_STREAM; |
|
2
|
|
|
|
|
|
|
{ |
|
3
|
|
|
|
|
|
|
$Protocol::SPDY::Frame::Control::SYN_STREAM::VERSION = '1.000'; |
|
4
|
|
|
|
|
|
|
} |
|
5
|
3
|
|
|
3
|
|
16
|
use strict; |
|
|
3
|
|
|
|
|
6
|
|
|
|
3
|
|
|
|
|
97
|
|
|
6
|
3
|
|
|
3
|
|
14
|
use warnings; |
|
|
3
|
|
|
|
|
6
|
|
|
|
3
|
|
|
|
|
84
|
|
|
7
|
3
|
|
|
3
|
|
54
|
use parent qw(Protocol::SPDY::Frame::HeaderSupport Protocol::SPDY::Frame::Control); |
|
|
3
|
|
|
|
|
12
|
|
|
|
3
|
|
|
|
|
15
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 NAME |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
Protocol::SPDY::Frame::Control::SYN_STREAM - stream creation request packet for SPDY protocol |
|
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
|
|
201
|
use Protocol::SPDY::Constants ':all'; |
|
|
3
|
|
|
|
|
6
|
|
|
|
3
|
|
|
|
|
2290
|
|
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head2 type_name |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
The string type for this frame ('SYN_STREAM'). |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=cut |
|
32
|
|
|
|
|
|
|
|
|
33
|
11
|
|
|
11
|
1
|
69
|
sub type_name { 'SYN_STREAM' } |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head2 new |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
Instantiate. |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=cut |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub new { |
|
42
|
18
|
|
|
18
|
1
|
33
|
my $class = shift; |
|
43
|
18
|
|
|
|
|
116
|
my %args = @_; |
|
44
|
18
|
50
|
50
|
|
|
85
|
$args{headers} = $class->header_hashref_to_arrayref($args{headers}) if (ref($args{headers}) || '') eq 'HASH'; |
|
45
|
18
|
|
|
|
|
146
|
$class->SUPER::new(%args) |
|
46
|
|
|
|
|
|
|
} |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head2 slot |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
Which credential slot we're using (unimplemented). |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=cut |
|
53
|
|
|
|
|
|
|
|
|
54
|
9
|
|
|
9
|
1
|
23
|
sub slot { shift->{slot} } |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head2 from_data |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
Instantiate from the given data. |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=cut |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub from_data { |
|
63
|
10
|
|
|
10
|
1
|
18
|
my $class = shift; |
|
64
|
10
|
|
|
|
|
50
|
my %args = @_; |
|
65
|
10
|
|
|
|
|
56
|
my ($stream_id, $associated_stream_id, $slot) = unpack "N1N1n1", substr $args{data}, 0, 10, ''; |
|
66
|
10
|
|
|
|
|
19
|
$stream_id &= ~0x80000000; |
|
67
|
10
|
|
|
|
|
16
|
$associated_stream_id &= ~0x80000000; |
|
68
|
10
|
|
|
|
|
19
|
my $pri = ($slot & 0xE000) >> 13; |
|
69
|
10
|
|
|
|
|
19
|
$slot &= 0xFF; |
|
70
|
|
|
|
|
|
|
|
|
71
|
10
|
|
|
|
|
23
|
my $zlib = delete $args{zlib}; |
|
72
|
10
|
|
|
|
|
48
|
my $out = $zlib->decompress($args{data}); |
|
73
|
10
|
|
|
|
|
92
|
my ($headers) = $class->extract_headers($out); |
|
74
|
10
|
|
|
|
|
70
|
$class->new( |
|
75
|
|
|
|
|
|
|
%args, |
|
76
|
|
|
|
|
|
|
stream_id => $stream_id, |
|
77
|
|
|
|
|
|
|
associated_stream_id => $associated_stream_id, |
|
78
|
|
|
|
|
|
|
priority => $pri, |
|
79
|
|
|
|
|
|
|
slot => $slot, |
|
80
|
|
|
|
|
|
|
headers => $headers, |
|
81
|
|
|
|
|
|
|
); |
|
82
|
|
|
|
|
|
|
} |
|
83
|
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head2 stream_id |
|
85
|
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
Our stream ID. |
|
87
|
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=cut |
|
89
|
|
|
|
|
|
|
|
|
90
|
25
|
|
|
25
|
1
|
2723
|
sub stream_id { shift->{stream_id} } |
|
91
|
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=head2 associated_stream_id |
|
93
|
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
The stream to which we're associated. |
|
95
|
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=cut |
|
97
|
|
|
|
|
|
|
|
|
98
|
11
|
|
|
11
|
1
|
66
|
sub associated_stream_id { shift->{associated_stream_id} } |
|
99
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=head2 priority |
|
101
|
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
Our priority. |
|
103
|
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=cut |
|
105
|
|
|
|
|
|
|
|
|
106
|
15
|
|
|
15
|
1
|
58
|
sub priority { shift->{priority} } |
|
107
|
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=head2 as_packet |
|
109
|
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
Returns byte representation for this frame. |
|
111
|
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=cut |
|
113
|
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
sub as_packet { |
|
115
|
9
|
|
|
9
|
1
|
16
|
my $self = shift; |
|
116
|
9
|
|
|
|
|
15
|
my $zlib = shift; |
|
117
|
9
|
|
|
|
|
33
|
my $payload = pack 'N1', $self->stream_id & 0x7FFFFFFF; |
|
118
|
9
|
|
50
|
|
|
29
|
$payload .= pack 'N1', ($self->associated_stream_id || 0) & 0x7FFFFFFF; |
|
119
|
9
|
|
|
|
|
27
|
$payload .= pack 'C1', ($self->priority & 0x07) << 5; |
|
120
|
9
|
|
|
|
|
33
|
$payload .= pack 'C1', $self->slot; |
|
121
|
9
|
|
|
|
|
14
|
my $block = $self->pairs_to_nv_header(map {; $_->[0], join "\0", @{$_}[1..$#$_] } @{$self->headers}); |
|
|
11
|
|
|
|
|
21
|
|
|
|
11
|
|
|
|
|
44
|
|
|
|
9
|
|
|
|
|
53
|
|
|
122
|
9
|
|
|
|
|
48
|
$payload .= $zlib->compress($block); |
|
123
|
9
|
|
|
|
|
61
|
return $self->SUPER::as_packet( |
|
124
|
|
|
|
|
|
|
payload => $payload, |
|
125
|
|
|
|
|
|
|
); |
|
126
|
|
|
|
|
|
|
} |
|
127
|
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=head2 to_string |
|
129
|
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
String representation, for debugging. |
|
131
|
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=cut |
|
133
|
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
sub to_string { |
|
135
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
|
136
|
0
|
|
|
|
|
|
$self->SUPER::to_string . ', id=' . $self->stream_id . ', ' . $self->header_line; |
|
137
|
|
|
|
|
|
|
} |
|
138
|
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
1; |
|
140
|
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
__END__ |