line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::SPDY::Compressor; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=head1 NAME |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
Net::SPDY::Compressor - SPDY header compressor |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 ALPHA WARNING |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
B This is an ALPHA stage software. |
10
|
|
|
|
|
|
|
In particular this means that even though it probably won't kill your cat, |
11
|
|
|
|
|
|
|
re-elect George W. Bush nor install Solaris 11 Express edition to your hard |
12
|
|
|
|
|
|
|
drive, it is in active development, functionality is missing and no APIs are |
13
|
|
|
|
|
|
|
stable. |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
See F file in the distribution to learn about missing and planned |
16
|
|
|
|
|
|
|
functionality. You are more than welcome to join the development and submit |
17
|
|
|
|
|
|
|
patches with fixes or enhancements. Bug reports are probably not very useful |
18
|
|
|
|
|
|
|
at this point. |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 SYNOPSIS |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
use Net::SPDY::Compressor; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
my $compr = new Net::SPDY::Compressor; |
25
|
|
|
|
|
|
|
print $compr->uncompress($compr->compress("Hello, World!\n")); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 DESCRIPTION |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
B provides a convenient way to compress data |
30
|
|
|
|
|
|
|
in a way used by the SPDY protocol. |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
This, in particular, means, that there are two separate streams (for input and |
33
|
|
|
|
|
|
|
output), streams are synced after each message and the stream is initialized |
34
|
|
|
|
|
|
|
with a dictionary of strings common to web communication. |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=cut |
37
|
|
|
|
|
|
|
|
38
|
18
|
|
|
18
|
|
647276
|
use strict; |
|
18
|
|
|
|
|
41
|
|
|
18
|
|
|
|
|
631
|
|
39
|
18
|
|
|
18
|
|
99
|
use warnings; |
|
18
|
|
|
|
|
32
|
|
|
18
|
|
|
|
|
542
|
|
40
|
|
|
|
|
|
|
|
41
|
18
|
|
|
18
|
|
20306
|
use Compress::Zlib qw/inflateInit deflateInit Z_SYNC_FLUSH/; |
|
18
|
|
|
|
|
1554143
|
|
|
18
|
|
|
|
|
24778
|
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
our $VERSION = '0.1'; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 CONSTANTS |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
For the actual values refer to the protocol specification. |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=over 4 |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=item C |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
The initial SPDY compression dictionary. |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=back |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=cut |
58
|
|
|
|
|
|
|
|
59
|
18
|
|
|
|
|
6188
|
use constant DICT => |
60
|
|
|
|
|
|
|
"\x00\x00\x00\x07\x6f\x70\x74\x69". #----opti |
61
|
|
|
|
|
|
|
"\x6f\x6e\x73\x00\x00\x00\x04\x68". #ons----h |
62
|
|
|
|
|
|
|
"\x65\x61\x64\x00\x00\x00\x04\x70". #ead----p |
63
|
|
|
|
|
|
|
"\x6f\x73\x74\x00\x00\x00\x03\x70". #ost----p |
64
|
|
|
|
|
|
|
"\x75\x74\x00\x00\x00\x06\x64\x65". #ut----de |
65
|
|
|
|
|
|
|
"\x6c\x65\x74\x65\x00\x00\x00\x05". #lete---- |
66
|
|
|
|
|
|
|
"\x74\x72\x61\x63\x65\x00\x00\x00". #trace--- |
67
|
|
|
|
|
|
|
"\x06\x61\x63\x63\x65\x70\x74\x00". #-accept- |
68
|
|
|
|
|
|
|
"\x00\x00\x0e\x61\x63\x63\x65\x70". #---accep |
69
|
|
|
|
|
|
|
"\x74\x2d\x63\x68\x61\x72\x73\x65". #t-charse |
70
|
|
|
|
|
|
|
"\x74\x00\x00\x00\x0f\x61\x63\x63". #t----acc |
71
|
|
|
|
|
|
|
"\x65\x70\x74\x2d\x65\x6e\x63\x6f". #ept-enco |
72
|
|
|
|
|
|
|
"\x64\x69\x6e\x67\x00\x00\x00\x0f". #ding---- |
73
|
|
|
|
|
|
|
"\x61\x63\x63\x65\x70\x74\x2d\x6c". #accept-l |
74
|
|
|
|
|
|
|
"\x61\x6e\x67\x75\x61\x67\x65\x00". #anguage- |
75
|
|
|
|
|
|
|
"\x00\x00\x0d\x61\x63\x63\x65\x70". #---accep |
76
|
|
|
|
|
|
|
"\x74\x2d\x72\x61\x6e\x67\x65\x73". #t-ranges |
77
|
|
|
|
|
|
|
"\x00\x00\x00\x03\x61\x67\x65\x00". #----age- |
78
|
|
|
|
|
|
|
"\x00\x00\x05\x61\x6c\x6c\x6f\x77". #---allow |
79
|
|
|
|
|
|
|
"\x00\x00\x00\x0d\x61\x75\x74\x68". #----auth |
80
|
|
|
|
|
|
|
"\x6f\x72\x69\x7a\x61\x74\x69\x6f". #orizatio |
81
|
|
|
|
|
|
|
"\x6e\x00\x00\x00\x0d\x63\x61\x63". #n----cac |
82
|
|
|
|
|
|
|
"\x68\x65\x2d\x63\x6f\x6e\x74\x72". #he-contr |
83
|
|
|
|
|
|
|
"\x6f\x6c\x00\x00\x00\x0a\x63\x6f". #ol----co |
84
|
|
|
|
|
|
|
"\x6e\x6e\x65\x63\x74\x69\x6f\x6e". #nnection |
85
|
|
|
|
|
|
|
"\x00\x00\x00\x0c\x63\x6f\x6e\x74". #----cont |
86
|
|
|
|
|
|
|
"\x65\x6e\x74\x2d\x62\x61\x73\x65". #ent-base |
87
|
|
|
|
|
|
|
"\x00\x00\x00\x10\x63\x6f\x6e\x74". #----cont |
88
|
|
|
|
|
|
|
"\x65\x6e\x74\x2d\x65\x6e\x63\x6f". #ent-enco |
89
|
|
|
|
|
|
|
"\x64\x69\x6e\x67\x00\x00\x00\x10". #ding---- |
90
|
|
|
|
|
|
|
"\x63\x6f\x6e\x74\x65\x6e\x74\x2d". #content- |
91
|
|
|
|
|
|
|
"\x6c\x61\x6e\x67\x75\x61\x67\x65". #language |
92
|
|
|
|
|
|
|
"\x00\x00\x00\x0e\x63\x6f\x6e\x74". #----cont |
93
|
|
|
|
|
|
|
"\x65\x6e\x74\x2d\x6c\x65\x6e\x67". #ent-leng |
94
|
|
|
|
|
|
|
"\x74\x68\x00\x00\x00\x10\x63\x6f". #th----co |
95
|
|
|
|
|
|
|
"\x6e\x74\x65\x6e\x74\x2d\x6c\x6f". #ntent-lo |
96
|
|
|
|
|
|
|
"\x63\x61\x74\x69\x6f\x6e\x00\x00". #cation-- |
97
|
|
|
|
|
|
|
"\x00\x0b\x63\x6f\x6e\x74\x65\x6e". #--conten |
98
|
|
|
|
|
|
|
"\x74\x2d\x6d\x64\x35\x00\x00\x00". #t-md5--- |
99
|
|
|
|
|
|
|
"\x0d\x63\x6f\x6e\x74\x65\x6e\x74". #-content |
100
|
|
|
|
|
|
|
"\x2d\x72\x61\x6e\x67\x65\x00\x00". #-range-- |
101
|
|
|
|
|
|
|
"\x00\x0c\x63\x6f\x6e\x74\x65\x6e". #--conten |
102
|
|
|
|
|
|
|
"\x74\x2d\x74\x79\x70\x65\x00\x00". #t-type-- |
103
|
|
|
|
|
|
|
"\x00\x04\x64\x61\x74\x65\x00\x00". #--date-- |
104
|
|
|
|
|
|
|
"\x00\x04\x65\x74\x61\x67\x00\x00". #--etag-- |
105
|
|
|
|
|
|
|
"\x00\x06\x65\x78\x70\x65\x63\x74". #--expect |
106
|
|
|
|
|
|
|
"\x00\x00\x00\x07\x65\x78\x70\x69". #----expi |
107
|
|
|
|
|
|
|
"\x72\x65\x73\x00\x00\x00\x04\x66". #res----f |
108
|
|
|
|
|
|
|
"\x72\x6f\x6d\x00\x00\x00\x04\x68". #rom----h |
109
|
|
|
|
|
|
|
"\x6f\x73\x74\x00\x00\x00\x08\x69". #ost----i |
110
|
|
|
|
|
|
|
"\x66\x2d\x6d\x61\x74\x63\x68\x00". #f-match- |
111
|
|
|
|
|
|
|
"\x00\x00\x11\x69\x66\x2d\x6d\x6f". #---if-mo |
112
|
|
|
|
|
|
|
"\x64\x69\x66\x69\x65\x64\x2d\x73". #dified-s |
113
|
|
|
|
|
|
|
"\x69\x6e\x63\x65\x00\x00\x00\x0d". #ince---- |
114
|
|
|
|
|
|
|
"\x69\x66\x2d\x6e\x6f\x6e\x65\x2d". #if-none- |
115
|
|
|
|
|
|
|
"\x6d\x61\x74\x63\x68\x00\x00\x00". #match--- |
116
|
|
|
|
|
|
|
"\x08\x69\x66\x2d\x72\x61\x6e\x67". #-if-rang |
117
|
|
|
|
|
|
|
"\x65\x00\x00\x00\x13\x69\x66\x2d". #e----if- |
118
|
|
|
|
|
|
|
"\x75\x6e\x6d\x6f\x64\x69\x66\x69". #unmodifi |
119
|
|
|
|
|
|
|
"\x65\x64\x2d\x73\x69\x6e\x63\x65". #ed-since |
120
|
|
|
|
|
|
|
"\x00\x00\x00\x0d\x6c\x61\x73\x74". #----last |
121
|
|
|
|
|
|
|
"\x2d\x6d\x6f\x64\x69\x66\x69\x65". #-modifie |
122
|
|
|
|
|
|
|
"\x64\x00\x00\x00\x08\x6c\x6f\x63". #d----loc |
123
|
|
|
|
|
|
|
"\x61\x74\x69\x6f\x6e\x00\x00\x00". #ation--- |
124
|
|
|
|
|
|
|
"\x0c\x6d\x61\x78\x2d\x66\x6f\x72". #-max-for |
125
|
|
|
|
|
|
|
"\x77\x61\x72\x64\x73\x00\x00\x00". #wards--- |
126
|
|
|
|
|
|
|
"\x06\x70\x72\x61\x67\x6d\x61\x00". #-pragma- |
127
|
|
|
|
|
|
|
"\x00\x00\x12\x70\x72\x6f\x78\x79". #---proxy |
128
|
|
|
|
|
|
|
"\x2d\x61\x75\x74\x68\x65\x6e\x74". #-authent |
129
|
|
|
|
|
|
|
"\x69\x63\x61\x74\x65\x00\x00\x00". #icate--- |
130
|
|
|
|
|
|
|
"\x13\x70\x72\x6f\x78\x79\x2d\x61". #-proxy-a |
131
|
|
|
|
|
|
|
"\x75\x74\x68\x6f\x72\x69\x7a\x61". #uthoriza |
132
|
|
|
|
|
|
|
"\x74\x69\x6f\x6e\x00\x00\x00\x05". #tion---- |
133
|
|
|
|
|
|
|
"\x72\x61\x6e\x67\x65\x00\x00\x00". #range--- |
134
|
|
|
|
|
|
|
"\x07\x72\x65\x66\x65\x72\x65\x72". #-referer |
135
|
|
|
|
|
|
|
"\x00\x00\x00\x0b\x72\x65\x74\x72". #----retr |
136
|
|
|
|
|
|
|
"\x79\x2d\x61\x66\x74\x65\x72\x00". #y-after- |
137
|
|
|
|
|
|
|
"\x00\x00\x06\x73\x65\x72\x76\x65". #---serve |
138
|
|
|
|
|
|
|
"\x72\x00\x00\x00\x02\x74\x65\x00". #r----te- |
139
|
|
|
|
|
|
|
"\x00\x00\x07\x74\x72\x61\x69\x6c". #---trail |
140
|
|
|
|
|
|
|
"\x65\x72\x00\x00\x00\x11\x74\x72". #er----tr |
141
|
|
|
|
|
|
|
"\x61\x6e\x73\x66\x65\x72\x2d\x65". #ansfer-e |
142
|
|
|
|
|
|
|
"\x6e\x63\x6f\x64\x69\x6e\x67\x00". #ncoding- |
143
|
|
|
|
|
|
|
"\x00\x00\x07\x75\x70\x67\x72\x61". #---upgra |
144
|
|
|
|
|
|
|
"\x64\x65\x00\x00\x00\x0a\x75\x73". #de----us |
145
|
|
|
|
|
|
|
"\x65\x72\x2d\x61\x67\x65\x6e\x74". #er-agent |
146
|
|
|
|
|
|
|
"\x00\x00\x00\x04\x76\x61\x72\x79". #----vary |
147
|
|
|
|
|
|
|
"\x00\x00\x00\x03\x76\x69\x61\x00". #----via- |
148
|
|
|
|
|
|
|
"\x00\x00\x07\x77\x61\x72\x6e\x69". #---warni |
149
|
|
|
|
|
|
|
"\x6e\x67\x00\x00\x00\x10\x77\x77". #ng----ww |
150
|
|
|
|
|
|
|
"\x77\x2d\x61\x75\x74\x68\x65\x6e". #w-authen |
151
|
|
|
|
|
|
|
"\x74\x69\x63\x61\x74\x65\x00\x00". #ticate-- |
152
|
|
|
|
|
|
|
"\x00\x06\x6d\x65\x74\x68\x6f\x64". #--method |
153
|
|
|
|
|
|
|
"\x00\x00\x00\x03\x67\x65\x74\x00". #----get- |
154
|
|
|
|
|
|
|
"\x00\x00\x06\x73\x74\x61\x74\x75". #---statu |
155
|
|
|
|
|
|
|
"\x73\x00\x00\x00\x06\x32\x30\x30". #s----200 |
156
|
|
|
|
|
|
|
"\x20\x4f\x4b\x00\x00\x00\x07\x76". #-OK----v |
157
|
|
|
|
|
|
|
"\x65\x72\x73\x69\x6f\x6e\x00\x00". #ersion-- |
158
|
|
|
|
|
|
|
"\x00\x08\x48\x54\x54\x50\x2f\x31". #--HTTP-1 |
159
|
|
|
|
|
|
|
"\x2e\x31\x00\x00\x00\x03\x75\x72". #-1----ur |
160
|
|
|
|
|
|
|
"\x6c\x00\x00\x00\x06\x70\x75\x62". #l----pub |
161
|
|
|
|
|
|
|
"\x6c\x69\x63\x00\x00\x00\x0a\x73". #lic----s |
162
|
|
|
|
|
|
|
"\x65\x74\x2d\x63\x6f\x6f\x6b\x69". #et-cooki |
163
|
|
|
|
|
|
|
"\x65\x00\x00\x00\x0a\x6b\x65\x65". #e----kee |
164
|
|
|
|
|
|
|
"\x70\x2d\x61\x6c\x69\x76\x65\x00". #p-alive- |
165
|
|
|
|
|
|
|
"\x00\x00\x06\x6f\x72\x69\x67\x69". #---origi |
166
|
|
|
|
|
|
|
"\x6e\x31\x30\x30\x31\x30\x31\x32". #n1001012 |
167
|
|
|
|
|
|
|
"\x30\x31\x32\x30\x32\x32\x30\x35". #01202205 |
168
|
|
|
|
|
|
|
"\x32\x30\x36\x33\x30\x30\x33\x30". #20630030 |
169
|
|
|
|
|
|
|
"\x32\x33\x30\x33\x33\x30\x34\x33". #23033043 |
170
|
|
|
|
|
|
|
"\x30\x35\x33\x30\x36\x33\x30\x37". #05306307 |
171
|
|
|
|
|
|
|
"\x34\x30\x32\x34\x30\x35\x34\x30". #40240540 |
172
|
|
|
|
|
|
|
"\x36\x34\x30\x37\x34\x30\x38\x34". #64074084 |
173
|
|
|
|
|
|
|
"\x30\x39\x34\x31\x30\x34\x31\x31". #09410411 |
174
|
|
|
|
|
|
|
"\x34\x31\x32\x34\x31\x33\x34\x31". #41241341 |
175
|
|
|
|
|
|
|
"\x34\x34\x31\x35\x34\x31\x36\x34". #44154164 |
176
|
|
|
|
|
|
|
"\x31\x37\x35\x30\x32\x35\x30\x34". #17502504 |
177
|
|
|
|
|
|
|
"\x35\x30\x35\x32\x30\x33\x20\x4e". #505203-N |
178
|
|
|
|
|
|
|
"\x6f\x6e\x2d\x41\x75\x74\x68\x6f". #on-Autho |
179
|
|
|
|
|
|
|
"\x72\x69\x74\x61\x74\x69\x76\x65". #ritative |
180
|
|
|
|
|
|
|
"\x20\x49\x6e\x66\x6f\x72\x6d\x61". #-Informa |
181
|
|
|
|
|
|
|
"\x74\x69\x6f\x6e\x32\x30\x34\x20". #tion204- |
182
|
|
|
|
|
|
|
"\x4e\x6f\x20\x43\x6f\x6e\x74\x65". #No-Conte |
183
|
|
|
|
|
|
|
"\x6e\x74\x33\x30\x31\x20\x4d\x6f". #nt301-Mo |
184
|
|
|
|
|
|
|
"\x76\x65\x64\x20\x50\x65\x72\x6d". #ved-Perm |
185
|
|
|
|
|
|
|
"\x61\x6e\x65\x6e\x74\x6c\x79\x34". #anently4 |
186
|
|
|
|
|
|
|
"\x30\x30\x20\x42\x61\x64\x20\x52". #00-Bad-R |
187
|
|
|
|
|
|
|
"\x65\x71\x75\x65\x73\x74\x34\x30". #equest40 |
188
|
|
|
|
|
|
|
"\x31\x20\x55\x6e\x61\x75\x74\x68". #1-Unauth |
189
|
|
|
|
|
|
|
"\x6f\x72\x69\x7a\x65\x64\x34\x30". #orized40 |
190
|
|
|
|
|
|
|
"\x33\x20\x46\x6f\x72\x62\x69\x64". #3-Forbid |
191
|
|
|
|
|
|
|
"\x64\x65\x6e\x34\x30\x34\x20\x4e". #den404-N |
192
|
|
|
|
|
|
|
"\x6f\x74\x20\x46\x6f\x75\x6e\x64". #ot-Found |
193
|
|
|
|
|
|
|
"\x35\x30\x30\x20\x49\x6e\x74\x65". #500-Inte |
194
|
|
|
|
|
|
|
"\x72\x6e\x61\x6c\x20\x53\x65\x72". #rnal-Ser |
195
|
|
|
|
|
|
|
"\x76\x65\x72\x20\x45\x72\x72\x6f". #ver-Erro |
196
|
|
|
|
|
|
|
"\x72\x35\x30\x31\x20\x4e\x6f\x74". #r501-Not |
197
|
|
|
|
|
|
|
"\x20\x49\x6d\x70\x6c\x65\x6d\x65". #-Impleme |
198
|
|
|
|
|
|
|
"\x6e\x74\x65\x64\x35\x30\x33\x20". #nted503- |
199
|
|
|
|
|
|
|
"\x53\x65\x72\x76\x69\x63\x65\x20". #Service- |
200
|
|
|
|
|
|
|
"\x55\x6e\x61\x76\x61\x69\x6c\x61". #Unavaila |
201
|
|
|
|
|
|
|
"\x62\x6c\x65\x4a\x61\x6e\x20\x46". #bleJan-F |
202
|
|
|
|
|
|
|
"\x65\x62\x20\x4d\x61\x72\x20\x41". #eb-Mar-A |
203
|
|
|
|
|
|
|
"\x70\x72\x20\x4d\x61\x79\x20\x4a". #pr-May-J |
204
|
|
|
|
|
|
|
"\x75\x6e\x20\x4a\x75\x6c\x20\x41". #un-Jul-A |
205
|
|
|
|
|
|
|
"\x75\x67\x20\x53\x65\x70\x74\x20". #ug-Sept- |
206
|
|
|
|
|
|
|
"\x4f\x63\x74\x20\x4e\x6f\x76\x20". #Oct-Nov- |
207
|
|
|
|
|
|
|
"\x44\x65\x63\x20\x30\x30\x3a\x30". #Dec-00-0 |
208
|
|
|
|
|
|
|
"\x30\x3a\x30\x30\x20\x4d\x6f\x6e". #0-00-Mon |
209
|
|
|
|
|
|
|
"\x2c\x20\x54\x75\x65\x2c\x20\x57". #--Tue--W |
210
|
|
|
|
|
|
|
"\x65\x64\x2c\x20\x54\x68\x75\x2c". #ed--Thu- |
211
|
|
|
|
|
|
|
"\x20\x46\x72\x69\x2c\x20\x53\x61". #-Fri--Sa |
212
|
|
|
|
|
|
|
"\x74\x2c\x20\x53\x75\x6e\x2c\x20". #t--Sun-- |
213
|
|
|
|
|
|
|
"\x47\x4d\x54\x63\x68\x75\x6e\x6b". #GMTchunk |
214
|
|
|
|
|
|
|
"\x65\x64\x2c\x74\x65\x78\x74\x2f". #ed-text- |
215
|
|
|
|
|
|
|
"\x68\x74\x6d\x6c\x2c\x69\x6d\x61". #html-ima |
216
|
|
|
|
|
|
|
"\x67\x65\x2f\x70\x6e\x67\x2c\x69". #ge-png-i |
217
|
|
|
|
|
|
|
"\x6d\x61\x67\x65\x2f\x6a\x70\x67". #mage-jpg |
218
|
|
|
|
|
|
|
"\x2c\x69\x6d\x61\x67\x65\x2f\x67". #-image-g |
219
|
|
|
|
|
|
|
"\x69\x66\x2c\x61\x70\x70\x6c\x69". #if-appli |
220
|
|
|
|
|
|
|
"\x63\x61\x74\x69\x6f\x6e\x2f\x78". #cation-x |
221
|
|
|
|
|
|
|
"\x6d\x6c\x2c\x61\x70\x70\x6c\x69". #ml-appli |
222
|
|
|
|
|
|
|
"\x63\x61\x74\x69\x6f\x6e\x2f\x78". #cation-x |
223
|
|
|
|
|
|
|
"\x68\x74\x6d\x6c\x2b\x78\x6d\x6c". #html-xml |
224
|
|
|
|
|
|
|
"\x2c\x74\x65\x78\x74\x2f\x70\x6c". #-text-pl |
225
|
|
|
|
|
|
|
"\x61\x69\x6e\x2c\x74\x65\x78\x74". #ain-text |
226
|
|
|
|
|
|
|
"\x2f\x6a\x61\x76\x61\x73\x63\x72". #-javascr |
227
|
|
|
|
|
|
|
"\x69\x70\x74\x2c\x70\x75\x62\x6c". #ipt-publ |
228
|
|
|
|
|
|
|
"\x69\x63\x70\x72\x69\x76\x61\x74". #icprivat |
229
|
|
|
|
|
|
|
"\x65\x6d\x61\x78\x2d\x61\x67\x65". #emax-age |
230
|
|
|
|
|
|
|
"\x3d\x67\x7a\x69\x70\x2c\x64\x65". #-gzip-de |
231
|
|
|
|
|
|
|
"\x66\x6c\x61\x74\x65\x2c\x73\x64". #flate-sd |
232
|
|
|
|
|
|
|
"\x63\x68\x63\x68\x61\x72\x73\x65". #chcharse |
233
|
|
|
|
|
|
|
"\x74\x3d\x75\x74\x66\x2d\x38\x63". #t-utf-8c |
234
|
|
|
|
|
|
|
"\x68\x61\x72\x73\x65\x74\x3d\x69". #harset-i |
235
|
|
|
|
|
|
|
"\x73\x6f\x2d\x38\x38\x35\x39\x2d". #so-8859- |
236
|
|
|
|
|
|
|
"\x31\x2c\x75\x74\x66\x2d\x2c\x2a". #1-utf--- |
237
|
18
|
|
|
18
|
|
180
|
"\x2c\x65\x6e\x71\x3d\x30\x2e"; #-enq-0- |
|
18
|
|
|
|
|
37
|
|
238
|
|
|
|
|
|
|
|
239
|
|
|
|
|
|
|
=head1 METHODS |
240
|
|
|
|
|
|
|
|
241
|
|
|
|
|
|
|
=over 4 |
242
|
|
|
|
|
|
|
|
243
|
|
|
|
|
|
|
=item new |
244
|
|
|
|
|
|
|
|
245
|
|
|
|
|
|
|
Creates a new compressor instance. |
246
|
|
|
|
|
|
|
|
247
|
|
|
|
|
|
|
=cut |
248
|
|
|
|
|
|
|
|
249
|
|
|
|
|
|
|
sub new |
250
|
|
|
|
|
|
|
{ |
251
|
74
|
|
|
74
|
1
|
1308721
|
my $class = shift; |
252
|
74
|
|
|
|
|
2570
|
my $self = bless {}, $class; |
253
|
|
|
|
|
|
|
|
254
|
|
|
|
|
|
|
# Initiate the Zlib streams |
255
|
74
|
|
|
|
|
316
|
my $status; |
256
|
74
|
|
|
|
|
4357
|
($self->{inflater}, $status) = inflateInit ( |
257
|
|
|
|
|
|
|
-Dictionary => DICT); |
258
|
74
|
50
|
|
|
|
60365
|
die $status if $status; |
259
|
74
|
|
|
|
|
1653
|
($self->{deflater}, $status) = deflateInit ( |
260
|
|
|
|
|
|
|
-Level => 0, |
261
|
|
|
|
|
|
|
-Dictionary => DICT); |
262
|
74
|
50
|
|
|
|
70852
|
die $status if $status; |
263
|
|
|
|
|
|
|
|
264
|
74
|
|
|
|
|
174672
|
return $self; |
265
|
|
|
|
|
|
|
} |
266
|
|
|
|
|
|
|
|
267
|
|
|
|
|
|
|
=item compress STRING |
268
|
|
|
|
|
|
|
|
269
|
|
|
|
|
|
|
Returns a compressed string. |
270
|
|
|
|
|
|
|
|
271
|
|
|
|
|
|
|
=cut |
272
|
|
|
|
|
|
|
|
273
|
|
|
|
|
|
|
sub compress |
274
|
|
|
|
|
|
|
{ |
275
|
8
|
|
|
8
|
1
|
73
|
my $self = shift; |
276
|
8
|
|
|
|
|
38
|
my $msg = shift; |
277
|
|
|
|
|
|
|
|
278
|
8
|
|
|
|
|
38
|
my ($o1, $o2, $status); |
279
|
8
|
|
|
|
|
74
|
($o1, $status) = $self->{deflater}->deflate ($msg); |
280
|
8
|
50
|
|
|
|
803
|
die $status if $status; |
281
|
8
|
|
|
|
|
344
|
($o2, $status) = $self->{deflater}->flush (Z_SYNC_FLUSH); |
282
|
8
|
50
|
|
|
|
912
|
die $status if $status; |
283
|
|
|
|
|
|
|
|
284
|
8
|
|
|
|
|
1277
|
return $o1.$o2; |
285
|
|
|
|
|
|
|
} |
286
|
|
|
|
|
|
|
|
287
|
|
|
|
|
|
|
=item uncompress STRING |
288
|
|
|
|
|
|
|
|
289
|
|
|
|
|
|
|
Returns an uncompressed string given a compressed one. |
290
|
|
|
|
|
|
|
|
291
|
|
|
|
|
|
|
=cut |
292
|
|
|
|
|
|
|
|
293
|
|
|
|
|
|
|
sub uncompress |
294
|
|
|
|
|
|
|
{ |
295
|
31
|
|
|
31
|
1
|
449
|
my $self = shift; |
296
|
31
|
|
|
|
|
61
|
my $msg = shift; |
297
|
|
|
|
|
|
|
|
298
|
31
|
|
|
|
|
244
|
my ($out, $status) = $self->{inflater}->inflate (\$msg); |
299
|
31
|
100
|
|
|
|
1578
|
die $status if $status; |
300
|
|
|
|
|
|
|
|
301
|
29
|
|
|
|
|
112
|
return $out; |
302
|
|
|
|
|
|
|
} |
303
|
|
|
|
|
|
|
|
304
|
|
|
|
|
|
|
=back |
305
|
|
|
|
|
|
|
|
306
|
|
|
|
|
|
|
=head1 SEE ALSO |
307
|
|
|
|
|
|
|
|
308
|
|
|
|
|
|
|
=over |
309
|
|
|
|
|
|
|
|
310
|
|
|
|
|
|
|
=item * |
311
|
|
|
|
|
|
|
|
312
|
|
|
|
|
|
|
L -- SPDY project web site |
313
|
|
|
|
|
|
|
|
314
|
|
|
|
|
|
|
=item * |
315
|
|
|
|
|
|
|
|
316
|
|
|
|
|
|
|
L -- Protocol specification |
317
|
|
|
|
|
|
|
|
318
|
|
|
|
|
|
|
=back |
319
|
|
|
|
|
|
|
|
320
|
|
|
|
|
|
|
=head1 CONTRIBUTING |
321
|
|
|
|
|
|
|
|
322
|
|
|
|
|
|
|
Source code for I is kept in a public GIT repository. |
323
|
|
|
|
|
|
|
Visit L. |
324
|
|
|
|
|
|
|
|
325
|
|
|
|
|
|
|
Bugs reports and feature enhancement requests are tracked at |
326
|
|
|
|
|
|
|
L. |
327
|
|
|
|
|
|
|
|
328
|
|
|
|
|
|
|
=head1 COPYRIGHT |
329
|
|
|
|
|
|
|
|
330
|
|
|
|
|
|
|
Copyright 2012, Lubomir Rintel |
331
|
|
|
|
|
|
|
|
332
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
333
|
|
|
|
|
|
|
under the same terms as Perl itself. |
334
|
|
|
|
|
|
|
|
335
|
|
|
|
|
|
|
=head1 AUTHOR |
336
|
|
|
|
|
|
|
|
337
|
|
|
|
|
|
|
Lubomir Rintel C |
338
|
|
|
|
|
|
|
|
339
|
|
|
|
|
|
|
=cut |
340
|
|
|
|
|
|
|
|
341
|
|
|
|
|
|
|
1; |