lsqpack 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +19 -0
- data/Gemfile.lock +82 -0
- data/LICENSE +21 -0
- data/README.md +36 -0
- data/Rakefile +19 -0
- data/Steepfile +6 -0
- data/ext/lsqpack/extconf.rb +18 -0
- data/ext/lsqpack/lsqpack.c +426 -0
- data/ext/lsqpack/lsqpack.h +6 -0
- data/lib/lsqpack/version.rb +5 -0
- data/lib/lsqpack.rb +30 -0
- data/ls-qpack/.appveyor.yml +14 -0
- data/ls-qpack/.cirrus.yml +6 -0
- data/ls-qpack/.travis.yml +32 -0
- data/ls-qpack/CMakeLists.txt +66 -0
- data/ls-qpack/LICENSE +21 -0
- data/ls-qpack/README.md +65 -0
- data/ls-qpack/bin/CMakeLists.txt +21 -0
- data/ls-qpack/bin/encode-int.c +87 -0
- data/ls-qpack/bin/fuzz-decode.c +247 -0
- data/ls-qpack/bin/interop-decode.c +433 -0
- data/ls-qpack/bin/interop-encode.c +554 -0
- data/ls-qpack/deps/xxhash/xxhash.c +941 -0
- data/ls-qpack/deps/xxhash/xxhash.h +160 -0
- data/ls-qpack/fuzz/decode/a/README +3 -0
- data/ls-qpack/fuzz/decode/a/preamble +0 -0
- data/ls-qpack/fuzz/decode/a/test-cases/id_000000,sig_06,src_000390,op_havoc,rep_4 +0 -0
- data/ls-qpack/fuzz/decode/a/test-cases/id_000000,sig_06,src_000579,op_flip1,pos_14 +0 -0
- data/ls-qpack/fuzz/decode/a/test-cases/id_000000,src_000000,op_flip2,pos_12 +0 -0
- data/ls-qpack/fuzz/decode/a/test-cases/id_000001,sig_11,src_000579,op_havoc,rep_4 +0 -0
- data/ls-qpack/fuzz/decode/a/test-cases/id_000002,sig_11,src_000481,op_int16,pos_15,val_-1 +0 -0
- data/ls-qpack/fuzz/decode/a/test-cases/id_000002,src_000000,op_havoc,rep_8 +0 -0
- data/ls-qpack/fuzz/decode/a/test-cases/id_000006,src_000285,op_flip2,pos_14 +0 -0
- data/ls-qpack/fuzz/decode/a/test-cases/id_000008,src_000285,op_flip2,pos_20 +0 -0
- data/ls-qpack/fuzz/decode/a/test-cases/id_000010,src_000306,op_flip2,pos_75 +0 -0
- data/ls-qpack/fuzz/decode/a/test-cases/id_000011,src_000344,op_havoc,rep_2 +0 -0
- data/ls-qpack/fuzz/decode/a/test-cases/id_000014,src_000366,op_flip2,pos_28 +0 -0
- data/ls-qpack/fuzz/decode/b/README +1 -0
- data/ls-qpack/fuzz/decode/b/preamble +0 -0
- data/ls-qpack/fuzz/decode/b/test-cases/seed +0 -0
- data/ls-qpack/fuzz/decode/c/setup.sh +3 -0
- data/ls-qpack/fuzz/decode/c/test-cases/fb-req.qif.proxygen.out.256.100.0-chopped +0 -0
- data/ls-qpack/fuzz/decode/d/preamble +0 -0
- data/ls-qpack/fuzz/decode/d/setup.sh +3 -0
- data/ls-qpack/fuzz/decode/d/test-cases/fb-resp.minhq.256.128.0.ack +0 -0
- data/ls-qpack/fuzz/input/256.100.1/fb-req.out.256.100.1 +0 -0
- data/ls-qpack/fuzz/input/256.100.1/fb-resp.out.256.100.1 +0 -0
- data/ls-qpack/fuzz/input/256.100.1/netbsd.out.256.100.1 +0 -0
- data/ls-qpack/huff-tables.h +136247 -0
- data/ls-qpack/lsqpack.c +5547 -0
- data/ls-qpack/lsqpack.h +768 -0
- data/ls-qpack/test/CMakeLists.txt +76 -0
- data/ls-qpack/test/lsqpack-test.h +43 -0
- data/ls-qpack/test/qifs/fb-req.qif +4917 -0
- data/ls-qpack/test/qifs/fb-resp.qif +5982 -0
- data/ls-qpack/test/qifs/long-codes.qif +5984 -0
- data/ls-qpack/test/qifs/netbsd.qif +235 -0
- data/ls-qpack/test/run-qif.pl +97 -0
- data/ls-qpack/test/run-scenario.sh +68 -0
- data/ls-qpack/test/scenarios/0.95-reset.sce +10 -0
- data/ls-qpack/test/scenarios/cancel-stream.sce +22 -0
- data/ls-qpack/test/scenarios/drain-2.sce +37 -0
- data/ls-qpack/test/scenarios/drain.sce +37 -0
- data/ls-qpack/test/scenarios/end-dst-2.sce +14 -0
- data/ls-qpack/test/scenarios/end-dst.sce +14 -0
- data/ls-qpack/test/scenarios/incl-name.sce +13 -0
- data/ls-qpack/test/scenarios/multi-byte-int-dyn-ref-1.sce +110 -0
- data/ls-qpack/test/scenarios/multi-byte-int-dyn-ref-2.sce +161 -0
- data/ls-qpack/test/scenarios/post-base-1.sce +10 -0
- data/ls-qpack/test/scenarios/post-base-2.sce +13 -0
- data/ls-qpack/test/scenarios/post-base-nr.sce +10 -0
- data/ls-qpack/test/scenarios/set-max-cap.sce +15 -0
- data/ls-qpack/test/test_enc_str.c +139 -0
- data/ls-qpack/test/test_get_stx_id.c +144 -0
- data/ls-qpack/test/test_huff_dec.c +399 -0
- data/ls-qpack/test/test_int.c +220 -0
- data/ls-qpack/test/test_qpack.c +856 -0
- data/ls-qpack/test/test_read_enc_stream.c +256 -0
- data/ls-qpack/tools/har2qif.pl +139 -0
- data/ls-qpack/tools/randomize-cookies.pl +41 -0
- data/ls-qpack/tools/sort-qif.pl +31 -0
- data/ls-qpack/wincompat/getopt.c +758 -0
- data/ls-qpack/wincompat/getopt.h +131 -0
- data/ls-qpack/wincompat/getopt1.c +188 -0
- data/ls-qpack/wincompat/sys/queue.h +859 -0
- data/lsqpack.gemspec +39 -0
- data/sig/lsqpack.rbs +29 -0
- metadata +135 -0
@@ -0,0 +1,235 @@
|
|
1
|
+
:method GET
|
2
|
+
:scheme http
|
3
|
+
:authority www.netbsd.org
|
4
|
+
:path /
|
5
|
+
user-agent Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0
|
6
|
+
accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
|
7
|
+
accept-language en-US,en;q=0.5
|
8
|
+
accept-encoding gzip, deflate
|
9
|
+
connection keep-alive
|
10
|
+
upgrade-insecure-requests 1
|
11
|
+
pragma no-cache
|
12
|
+
cache-control no-cache
|
13
|
+
|
14
|
+
:method GET
|
15
|
+
:scheme http
|
16
|
+
:authority www.netbsd.org
|
17
|
+
:path /global.css
|
18
|
+
user-agent Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0
|
19
|
+
accept text/css,*/*;q=0.1
|
20
|
+
accept-language en-US,en;q=0.5
|
21
|
+
accept-encoding gzip, deflate
|
22
|
+
referer http://www.netbsd.org/
|
23
|
+
connection keep-alive
|
24
|
+
pragma no-cache
|
25
|
+
cache-control no-cache
|
26
|
+
|
27
|
+
:method GET
|
28
|
+
:scheme http
|
29
|
+
:authority www.netbsd.org
|
30
|
+
:path /global.js
|
31
|
+
user-agent Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0
|
32
|
+
accept */*
|
33
|
+
accept-language en-US,en;q=0.5
|
34
|
+
accept-encoding gzip, deflate
|
35
|
+
referer http://www.netbsd.org/
|
36
|
+
connection keep-alive
|
37
|
+
pragma no-cache
|
38
|
+
cache-control no-cache
|
39
|
+
|
40
|
+
:method GET
|
41
|
+
:scheme http
|
42
|
+
:authority www.netbsd.org
|
43
|
+
:path /donations/donors.js
|
44
|
+
user-agent Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0
|
45
|
+
accept */*
|
46
|
+
accept-language en-US,en;q=0.5
|
47
|
+
accept-encoding gzip, deflate
|
48
|
+
referer http://www.netbsd.org/
|
49
|
+
connection keep-alive
|
50
|
+
pragma no-cache
|
51
|
+
cache-control no-cache
|
52
|
+
|
53
|
+
:method GET
|
54
|
+
:scheme http
|
55
|
+
:authority www.netbsd.org
|
56
|
+
:path /images/NetBSD-smaller.png
|
57
|
+
user-agent Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0
|
58
|
+
accept */*
|
59
|
+
accept-language en-US,en;q=0.5
|
60
|
+
accept-encoding gzip, deflate
|
61
|
+
referer http://www.netbsd.org/
|
62
|
+
connection keep-alive
|
63
|
+
pragma no-cache
|
64
|
+
cache-control no-cache
|
65
|
+
|
66
|
+
:method GET
|
67
|
+
:scheme http
|
68
|
+
:authority www.netbsd.org
|
69
|
+
:path /images/download-icon-orange.png
|
70
|
+
user-agent Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0
|
71
|
+
accept */*
|
72
|
+
accept-language en-US,en;q=0.5
|
73
|
+
accept-encoding gzip, deflate
|
74
|
+
referer http://www.netbsd.org/
|
75
|
+
connection keep-alive
|
76
|
+
pragma no-cache
|
77
|
+
cache-control no-cache
|
78
|
+
|
79
|
+
:method GET
|
80
|
+
:scheme http
|
81
|
+
:authority www.netbsd.org
|
82
|
+
:path /images/support-icon-orange.png
|
83
|
+
user-agent Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0
|
84
|
+
accept */*
|
85
|
+
accept-language en-US,en;q=0.5
|
86
|
+
accept-encoding gzip, deflate
|
87
|
+
referer http://www.netbsd.org/
|
88
|
+
connection keep-alive
|
89
|
+
pragma no-cache
|
90
|
+
cache-control no-cache
|
91
|
+
|
92
|
+
:method GET
|
93
|
+
:scheme http
|
94
|
+
:authority www.netbsd.org
|
95
|
+
:path /images/community-icon-orange.png
|
96
|
+
user-agent Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0
|
97
|
+
accept */*
|
98
|
+
accept-language en-US,en;q=0.5
|
99
|
+
accept-encoding gzip, deflate
|
100
|
+
referer http://www.netbsd.org/
|
101
|
+
connection keep-alive
|
102
|
+
pragma no-cache
|
103
|
+
cache-control no-cache
|
104
|
+
|
105
|
+
:method GET
|
106
|
+
:scheme http
|
107
|
+
:authority www.netbsd.org
|
108
|
+
:path /images/develop-icon-orange.png
|
109
|
+
user-agent Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0
|
110
|
+
accept */*
|
111
|
+
accept-language en-US,en;q=0.5
|
112
|
+
accept-encoding gzip, deflate
|
113
|
+
referer http://www.netbsd.org/
|
114
|
+
connection keep-alive
|
115
|
+
pragma no-cache
|
116
|
+
cache-control no-cache
|
117
|
+
|
118
|
+
:method GET
|
119
|
+
:scheme http
|
120
|
+
:authority www.netbsd.org
|
121
|
+
:path /images/donate-icon-orange.png
|
122
|
+
user-agent Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0
|
123
|
+
accept */*
|
124
|
+
accept-language en-US,en;q=0.5
|
125
|
+
accept-encoding gzip, deflate
|
126
|
+
referer http://www.netbsd.org/
|
127
|
+
connection keep-alive
|
128
|
+
pragma no-cache
|
129
|
+
cache-control no-cache
|
130
|
+
|
131
|
+
:method GET
|
132
|
+
:scheme http
|
133
|
+
:authority www.netbsd.org
|
134
|
+
:path /images/links/paypal.gif
|
135
|
+
user-agent Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0
|
136
|
+
accept */*
|
137
|
+
accept-language en-US,en;q=0.5
|
138
|
+
accept-encoding gzip, deflate
|
139
|
+
referer http://www.netbsd.org/
|
140
|
+
connection keep-alive
|
141
|
+
pragma no-cache
|
142
|
+
cache-control no-cache
|
143
|
+
|
144
|
+
:method GET
|
145
|
+
:scheme http
|
146
|
+
:authority www.netbsd.org
|
147
|
+
:path /images/links/stripe-black-donate-small.png
|
148
|
+
user-agent Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0
|
149
|
+
accept */*
|
150
|
+
accept-language en-US,en;q=0.5
|
151
|
+
accept-encoding gzip, deflate
|
152
|
+
referer http://www.netbsd.org/
|
153
|
+
connection keep-alive
|
154
|
+
pragma no-cache
|
155
|
+
cache-control no-cache
|
156
|
+
|
157
|
+
:method GET
|
158
|
+
:scheme http
|
159
|
+
:authority www.netbsd.org
|
160
|
+
:path /images/links/cafepress.png
|
161
|
+
user-agent Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0
|
162
|
+
accept */*
|
163
|
+
accept-language en-US,en;q=0.5
|
164
|
+
accept-encoding gzip, deflate
|
165
|
+
referer http://www.netbsd.org/
|
166
|
+
connection keep-alive
|
167
|
+
pragma no-cache
|
168
|
+
cache-control no-cache
|
169
|
+
|
170
|
+
:method GET
|
171
|
+
:scheme http
|
172
|
+
:authority www.netbsd.org
|
173
|
+
:path /images/westernlogo_sm.png
|
174
|
+
user-agent Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0
|
175
|
+
accept */*
|
176
|
+
accept-language en-US,en;q=0.5
|
177
|
+
accept-encoding gzip, deflate
|
178
|
+
referer http://www.netbsd.org/
|
179
|
+
connection keep-alive
|
180
|
+
pragma no-cache
|
181
|
+
cache-control no-cache
|
182
|
+
|
183
|
+
:method GET
|
184
|
+
:scheme http
|
185
|
+
:authority www.netbsd.org
|
186
|
+
:path /images/columbia.jpg
|
187
|
+
user-agent Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0
|
188
|
+
accept */*
|
189
|
+
accept-language en-US,en;q=0.5
|
190
|
+
accept-encoding gzip, deflate
|
191
|
+
referer http://www.netbsd.org/
|
192
|
+
connection keep-alive
|
193
|
+
pragma no-cache
|
194
|
+
cache-control no-cache
|
195
|
+
|
196
|
+
:method GET
|
197
|
+
:scheme http
|
198
|
+
:authority www.netbsd.org
|
199
|
+
:path /images/fastly.png
|
200
|
+
user-agent Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0
|
201
|
+
accept */*
|
202
|
+
accept-language en-US,en;q=0.5
|
203
|
+
accept-encoding gzip, deflate
|
204
|
+
referer http://www.netbsd.org/
|
205
|
+
connection keep-alive
|
206
|
+
pragma no-cache
|
207
|
+
cache-control no-cache
|
208
|
+
|
209
|
+
:method GET
|
210
|
+
:scheme http
|
211
|
+
:authority www.netbsd.org
|
212
|
+
:path /images/navBar-gradient.png
|
213
|
+
user-agent Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0
|
214
|
+
accept */*
|
215
|
+
accept-language en-US,en;q=0.5
|
216
|
+
accept-encoding gzip, deflate
|
217
|
+
referer http://www.netbsd.org/global.css
|
218
|
+
connection keep-alive
|
219
|
+
pragma no-cache
|
220
|
+
cache-control no-cache
|
221
|
+
|
222
|
+
:method GET
|
223
|
+
:scheme https
|
224
|
+
:authority www.paypalobjects.com
|
225
|
+
:path /en_US/i/btn/btn_subscribe_SM.gif
|
226
|
+
user-agent Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0
|
227
|
+
accept */*
|
228
|
+
accept-language en-US,en;q=0.5
|
229
|
+
accept-encoding gzip, deflate, br
|
230
|
+
referer http://www.netbsd.org/
|
231
|
+
cookie PYPF=CT-2
|
232
|
+
connection keep-alive
|
233
|
+
pragma no-cache
|
234
|
+
cache-control no-cache
|
235
|
+
|
@@ -0,0 +1,97 @@
|
|
1
|
+
#!/usr/bin/perl
|
2
|
+
#
|
3
|
+
# Script to run a QIF file.
|
4
|
+
|
5
|
+
use strict;
|
6
|
+
use warnings;
|
7
|
+
|
8
|
+
use File::Compare qw(compare);
|
9
|
+
use File::Copy qw(copy);
|
10
|
+
use File::Path qw(remove_tree);
|
11
|
+
use File::Spec::Functions qw(catfile);
|
12
|
+
use Getopt::Long qw(GetOptions);
|
13
|
+
|
14
|
+
my $cleanup = 1;
|
15
|
+
|
16
|
+
GetOptions(
|
17
|
+
"aggressive=i" => \my $aggressive,
|
18
|
+
"table-size=i" => \my $table_size,
|
19
|
+
"immed-ack=i" => \my $immed_ack,
|
20
|
+
"risked-streams=i" => \my $risked_streams,
|
21
|
+
"no-cleanup" => sub { $cleanup = 0 },
|
22
|
+
);
|
23
|
+
|
24
|
+
my $dir = catfile(($ENV{TMP} || $ENV{TEMP} || "/tmp"),
|
25
|
+
"run-qif-out-" . rand . $$);
|
26
|
+
mkdir $dir or die "cannot create temp directory $dir";
|
27
|
+
if (!$cleanup)
|
28
|
+
{
|
29
|
+
print "created temp directory: $dir\n";
|
30
|
+
}
|
31
|
+
|
32
|
+
END {
|
33
|
+
if (defined($dir) && $cleanup) {
|
34
|
+
remove_tree($dir);
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
38
|
+
my $encode_log = catfile($dir, "encode.log");
|
39
|
+
my $qif_file = catfile($dir, "qif");
|
40
|
+
my $bin_file = catfile($dir, "out");
|
41
|
+
my $resulting_qif_file = catfile($dir, "qif-result");
|
42
|
+
|
43
|
+
my ($encode_args, $decode_args) = ('', '');
|
44
|
+
if ($aggressive) {
|
45
|
+
$encode_args="$encode_args -A";
|
46
|
+
}
|
47
|
+
|
48
|
+
if ($immed_ack) {
|
49
|
+
$encode_args="$encode_args -a 1";
|
50
|
+
}
|
51
|
+
|
52
|
+
if (defined $risked_streams) {
|
53
|
+
$encode_args = "$encode_args -s $risked_streams";
|
54
|
+
$decode_args = "$decode_args -s $risked_streams";
|
55
|
+
}
|
56
|
+
|
57
|
+
if (defined $table_size) {
|
58
|
+
$encode_args = "$encode_args -t $table_size";
|
59
|
+
$decode_args = "$decode_args -t $table_size";
|
60
|
+
}
|
61
|
+
|
62
|
+
copy($ARGV[0], $qif_file) or die "cannot copy original $ARGV[0] to $qif_file";
|
63
|
+
|
64
|
+
if ($^O eq 'MSWin32') {
|
65
|
+
system('interop-encode', $encode_args, '-i', $qif_file, '-o', $bin_file)
|
66
|
+
and die "interop-encode failed";
|
67
|
+
system('interop-decode', $decode_args, '-m', '1', '-i', $bin_file, '-o', $resulting_qif_file)
|
68
|
+
and die "interop-decode failed";
|
69
|
+
} else {
|
70
|
+
system("interop-encode $encode_args -i $qif_file -o $bin_file")
|
71
|
+
and die "interop-encode failed";
|
72
|
+
system("interop-decode $decode_args -m 1 -i $bin_file -o $resulting_qif_file")
|
73
|
+
and die "interop-decode failed";
|
74
|
+
}
|
75
|
+
|
76
|
+
sub sort_qif {
|
77
|
+
no warnings 'uninitialized';
|
78
|
+
my ($in, $out) = @_;
|
79
|
+
local $/ = "\n\n";
|
80
|
+
open F, $in or die "cannot open $in for reading: $!";
|
81
|
+
my @chunks = map $$_[1],
|
82
|
+
sort { $$a[0] <=> $$b[0] }
|
83
|
+
map { /^#\s*stream\s+(\d+)/; [ $1, $_ ] }
|
84
|
+
<F>;
|
85
|
+
close F;
|
86
|
+
for (@chunks) {
|
87
|
+
s/^#.*\n//mg;
|
88
|
+
}
|
89
|
+
open F, ">", $out or die "cannot open $out for writing: $!";
|
90
|
+
print F @chunks;
|
91
|
+
close F;
|
92
|
+
}
|
93
|
+
|
94
|
+
sort_qif($qif_file, "$qif_file.canonical");
|
95
|
+
sort_qif($resulting_qif_file, "$resulting_qif_file.canonical");
|
96
|
+
|
97
|
+
exit compare "$qif_file.canonical", "$resulting_qif_file.canonical";
|
@@ -0,0 +1,68 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
#
|
3
|
+
# Script to run a scenario file. A scenario file contains encoder parameters
|
4
|
+
# as well as a list of headers in QIF format. The headers are encoded and
|
5
|
+
# the output is then decoded and compared to the original.
|
6
|
+
|
7
|
+
set -x
|
8
|
+
set -e
|
9
|
+
|
10
|
+
for NEED in interop-encode interop-decode sort-qif.pl; do
|
11
|
+
type $NEED
|
12
|
+
if [ $? -ne 0 ]; then
|
13
|
+
echo $NEED is not in $PATH 1>&2
|
14
|
+
exit 1
|
15
|
+
fi
|
16
|
+
done
|
17
|
+
|
18
|
+
function cleanup {
|
19
|
+
rm -vf $QIF_FILE
|
20
|
+
rm -vf $BIN_FILE
|
21
|
+
rm -vf $RESULTING_QIF_FILE
|
22
|
+
rm -vf $ENCODE_LOG
|
23
|
+
rmdir $DIR
|
24
|
+
}
|
25
|
+
|
26
|
+
if [ -z "$DO_CLEANUP" -o "$DO_CLEANUP" != 0 ]; then
|
27
|
+
trap cleanup EXIT
|
28
|
+
fi
|
29
|
+
|
30
|
+
RECIPE=$1
|
31
|
+
|
32
|
+
source $RECIPE
|
33
|
+
|
34
|
+
DIR=/tmp/recipe-out-$$$RANDOM
|
35
|
+
ENCODE_LOG=$DIR/encode.log
|
36
|
+
QIF_FILE=$DIR/qif
|
37
|
+
BIN_FILE=$DIR/out
|
38
|
+
RESULTING_QIF_FILE=$DIR/qif-result
|
39
|
+
mkdir -p $DIR
|
40
|
+
|
41
|
+
if [ "$AGGRESSIVE" = 1 ]; then
|
42
|
+
ENCODE_ARGS="$ENCODE_ARGS -A"
|
43
|
+
fi
|
44
|
+
|
45
|
+
if [ "$IMMEDIATE_ACK" = 1 ]; then
|
46
|
+
ENCODE_ARGS="$ENCODE_ARGS -a 1"
|
47
|
+
fi
|
48
|
+
|
49
|
+
if [ "$ANNOTATIONS" = 1 ]; then
|
50
|
+
ENCODE_ARGS="$ENCODE_ARGS -n"
|
51
|
+
fi
|
52
|
+
|
53
|
+
if [ -n "$RISKED_STREAMS" ]; then
|
54
|
+
ENCODE_ARGS="$ENCODE_ARGS -s $RISKED_STREAMS"
|
55
|
+
DECODE_ARGS="$DECODE_ARGS -s $RISKED_STREAMS"
|
56
|
+
fi
|
57
|
+
|
58
|
+
if [ -n "$TABLE_SIZE" ]; then
|
59
|
+
ENCODE_ARGS="$ENCODE_ARGS -t $TABLE_SIZE"
|
60
|
+
DECODE_ARGS="$DECODE_ARGS -t $TABLE_SIZE"
|
61
|
+
fi
|
62
|
+
|
63
|
+
echo -e "$QIF"\\n > $QIF_FILE
|
64
|
+
|
65
|
+
interop-encode $ENCODE_ARGS -i $QIF_FILE -o $BIN_FILE 2>$ENCODE_LOG
|
66
|
+
interop-decode $DECODE_ARGS -i $BIN_FILE -o $RESULTING_QIF_FILE
|
67
|
+
diff <(sort-qif.pl --strip $QIF_FILE) \
|
68
|
+
<(sort-qif.pl --strip $RESULTING_QIF_FILE)
|
@@ -0,0 +1,22 @@
|
|
1
|
+
TABLE_SIZE=256
|
2
|
+
ANNOTATIONS=1
|
3
|
+
QIF=$(cat<<'EOQ'
|
4
|
+
dude nude
|
5
|
+
dude nude
|
6
|
+
## c 1
|
7
|
+
dude where is my car?
|
8
|
+
|
9
|
+
one fish
|
10
|
+
two fish
|
11
|
+
## c 2
|
12
|
+
red fish
|
13
|
+
blue fish
|
14
|
+
|
15
|
+
black fish
|
16
|
+
blue fish
|
17
|
+
## c 3
|
18
|
+
old fish
|
19
|
+
new fish
|
20
|
+
|
21
|
+
EOQ
|
22
|
+
)
|
@@ -0,0 +1,37 @@
|
|
1
|
+
TABLE_SIZE=512
|
2
|
+
ANNOTATIONS=1
|
3
|
+
AGGRESSIVE=0
|
4
|
+
RISKED_STREAMS=0
|
5
|
+
IMMEDIATE_ACK=0
|
6
|
+
QIF=$(cat<<'EOQ'
|
7
|
+
notre dame translates to our lady of paris
|
8
|
+
iconography poor peoples book
|
9
|
+
spire must be repaired
|
10
|
+
sainte-chapelle is known as the kingdom of light
|
11
|
+
notre dame translates our to lady of paris
|
12
|
+
iconography poor peoples book
|
13
|
+
## s 2
|
14
|
+
|
15
|
+
notre dame translates to our lady of paris
|
16
|
+
iconography poor peoples book
|
17
|
+
|
18
|
+
victor hugo wrote the hunchback
|
19
|
+
archdiocese of paris
|
20
|
+
twelve million people visit annually
|
21
|
+
coronation of emperor napoleon
|
22
|
+
most famous gothic cathedral
|
23
|
+
|
24
|
+
victor hugo wrote the hunchback
|
25
|
+
archdiocese of paris
|
26
|
+
twelve million people visit annually
|
27
|
+
coronation of emperor napoleon
|
28
|
+
most famous gothic cathedral
|
29
|
+
|
30
|
+
notre dame translates to our lady of paris
|
31
|
+
iconography poor peoples book
|
32
|
+
|
33
|
+
notre dame translates to our lady of paris
|
34
|
+
iconography poor peoples book
|
35
|
+
|
36
|
+
EOQ
|
37
|
+
)
|
@@ -0,0 +1,37 @@
|
|
1
|
+
TABLE_SIZE=512
|
2
|
+
ANNOTATIONS=1
|
3
|
+
AGGRESSIVE=0
|
4
|
+
RISKED_STREAMS=0
|
5
|
+
IMMEDIATE_ACK=0
|
6
|
+
QIF=$(cat<<'EOQ'
|
7
|
+
notre dame translates to our lady of paris
|
8
|
+
iconography poor peoples book
|
9
|
+
spire must be repaired
|
10
|
+
sainte-chapelle is known as the kingdom of light
|
11
|
+
notre dame translates to our lady of paris
|
12
|
+
iconography poor peoples book
|
13
|
+
## s 2
|
14
|
+
|
15
|
+
notre dame translates to our lady of paris
|
16
|
+
iconography poor peoples book
|
17
|
+
|
18
|
+
victor hugo wrote the hunchback
|
19
|
+
archdiocese of paris
|
20
|
+
twelve million people visit annually
|
21
|
+
coronation of emperor napoleon
|
22
|
+
most famous gothic cathedral
|
23
|
+
|
24
|
+
victor hugo wrote the hunchback
|
25
|
+
archdiocese of paris
|
26
|
+
twelve million people visit annually
|
27
|
+
coronation of emperor napoleon
|
28
|
+
most famous gothic cathedral
|
29
|
+
|
30
|
+
notre dame translates to our lady of paris
|
31
|
+
iconography poor peoples book
|
32
|
+
|
33
|
+
notre dame translates to our lady of paris
|
34
|
+
iconography poor peoples book
|
35
|
+
|
36
|
+
EOQ
|
37
|
+
)
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# This scenario is designed to reach the 'case HUFF_DEC_END_DST'
|
2
|
+
# in lsqpack_dec_enc_in().
|
3
|
+
TABLE_SIZE=256
|
4
|
+
AGGRESSIVE=0
|
5
|
+
RISKED_STREAMS=0
|
6
|
+
QIF=$(cat<<'EOQ'
|
7
|
+
aaaaaaaaaaaaaaaaaaaaaaaaa aaaa
|
8
|
+
bbbbbbbbbbbbbbbbbbbbbbbbb bbbb
|
9
|
+
|
10
|
+
aaaaaaaaaaaaaaaaaaaaaaaaa aaaa
|
11
|
+
bbbbbbbbbbbbbbbbbbbbbbbbb bbbb
|
12
|
+
|
13
|
+
EOQ
|
14
|
+
)
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# This scenario is designed to reach the 'case HUFF_DEC_END_DST'
|
2
|
+
# in parse_header_data() when Huffman encoding is turned on.
|
3
|
+
TABLE_SIZE=256
|
4
|
+
AGGRESSIVE=1
|
5
|
+
RISKED_STREAMS=1
|
6
|
+
QIF=$(cat<<'EOQ'
|
7
|
+
aaaa aaa
|
8
|
+
aaaa aaaaa
|
9
|
+
aaaa aaaaaaaa
|
10
|
+
aaaa aaaaaaaaaaaaa
|
11
|
+
aaaa aaaaaaaaaaaaaaaaaaaaa
|
12
|
+
|
13
|
+
EOQ
|
14
|
+
)
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# This scenario is designed to reach 'case DATA_STATE_READ_LFONR_NAME_PLAIN'
|
2
|
+
# in parse_header_data(). It contains header names that are be too small
|
3
|
+
# for Huffman coding.
|
4
|
+
TABLE_SIZE=256
|
5
|
+
AGGRESSIVE=1
|
6
|
+
RISKED_STREAMS=0
|
7
|
+
QIF=$(cat<<'EOQ'
|
8
|
+
yo I
|
9
|
+
no do not
|
10
|
+
se know
|
11
|
+
|
12
|
+
EOQ
|
13
|
+
)
|
@@ -0,0 +1,110 @@
|
|
1
|
+
# This scenario is designed to reach the `case EEA_INS_NAMEREF_DYNAMIC`
|
2
|
+
# in the `lsqpack_enc_encode` function. It is intended to fail the integer
|
3
|
+
# encoding due to buffer length. To trigger this case, many names must be
|
4
|
+
# inserted into the dynamic table so that the integer encoding requires
|
5
|
+
# more than one byte.
|
6
|
+
TABLE_SIZE=16384
|
7
|
+
AGGRESSIVE=1
|
8
|
+
IMMEDIATE_ACK=0
|
9
|
+
RISKED_STREAMS=1000
|
10
|
+
QIF=$(cat<<'EOQ'
|
11
|
+
aaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaa
|
12
|
+
bbbbbbbbbbbbb bbbbbbbbbbbbbbbbbbbbbbbbbb
|
13
|
+
ccccccccccccc cccccccccccccccccccccccccc
|
14
|
+
ddddddddddddd dddddddddddddddddddddddddd
|
15
|
+
eeeeeeeeeeeee eeeeeeeeeeeeeeeeeeeeeeeeee
|
16
|
+
fffffffffffff ffffffffffffffffffffffffff
|
17
|
+
ggggggggggggg gggggggggggggggggggggggggg
|
18
|
+
aaaa oneeeeeeeee
|
19
|
+
bbbb oneeeeeeeee
|
20
|
+
cccc oneeeeeeeee
|
21
|
+
dddd oneeeeeeeee
|
22
|
+
eeee oneeeeeeeee
|
23
|
+
ffff oneeeeeeeee
|
24
|
+
gggg oneeeeeeeee
|
25
|
+
hhhh oneeeeeeeee
|
26
|
+
iiii oneeeeeeeee
|
27
|
+
jjjj oneeeeeeeee
|
28
|
+
kkkk oneeeeeeeee
|
29
|
+
llll oneeeeeeeee
|
30
|
+
mmmm oneeeeeeeee
|
31
|
+
nnnn oneeeeeeeee
|
32
|
+
oooo oneeeeeeeee
|
33
|
+
pppp oneeeeeeeee
|
34
|
+
qqqq oneeeeeeeee
|
35
|
+
rrrr oneeeeeeeee
|
36
|
+
ssss oneeeeeeeee
|
37
|
+
tttt oneeeeeeeee
|
38
|
+
uuuu oneeeeeeeee
|
39
|
+
vvvv oneeeeeeeee
|
40
|
+
wwww oneeeeeeeee
|
41
|
+
xxxx oneeeeeeeee
|
42
|
+
yyyy oneeeeeeeee
|
43
|
+
zzzz oneeeeeeeee
|
44
|
+
aabb oneeeeeeeee
|
45
|
+
bbcc oneeeeeeeee
|
46
|
+
ccdd oneeeeeeeee
|
47
|
+
ddee oneeeeeeeee
|
48
|
+
eeff oneeeeeeeee
|
49
|
+
ffgg oneeeeeeeee
|
50
|
+
gghh oneeeeeeeee
|
51
|
+
hhii oneeeeeeeee
|
52
|
+
iijj oneeeeeeeee
|
53
|
+
jjkk oneeeeeeeee
|
54
|
+
kkll oneeeeeeeee
|
55
|
+
llmm oneeeeeeeee
|
56
|
+
mmnn oneeeeeeeee
|
57
|
+
nnoo oneeeeeeeee
|
58
|
+
oopp oneeeeeeeee
|
59
|
+
ppqq oneeeeeeeee
|
60
|
+
qqrr oneeeeeeeee
|
61
|
+
rrss oneeeeeeeee
|
62
|
+
sstt oneeeeeeeee
|
63
|
+
ttuu oneeeeeeeee
|
64
|
+
uuvv oneeeeeeeee
|
65
|
+
vvww oneeeeeeeee
|
66
|
+
wwxx oneeeeeeeee
|
67
|
+
xxyy oneeeeeeeee
|
68
|
+
yyzz oneeeeeeeee
|
69
|
+
|
70
|
+
bbbb two
|
71
|
+
cccc two
|
72
|
+
dddd two
|
73
|
+
eeee two
|
74
|
+
ffff two
|
75
|
+
gggg two
|
76
|
+
hhhh two
|
77
|
+
yyyy two
|
78
|
+
zzzz two
|
79
|
+
aabb two
|
80
|
+
bbcc two
|
81
|
+
ccdd two
|
82
|
+
ddee two
|
83
|
+
eeff two
|
84
|
+
ffgg two
|
85
|
+
gghh two
|
86
|
+
hhii two
|
87
|
+
iijj two
|
88
|
+
jjkk two
|
89
|
+
kkll two
|
90
|
+
llmm two
|
91
|
+
mmnn two
|
92
|
+
nnoo two
|
93
|
+
oopp two
|
94
|
+
ppqq two
|
95
|
+
qqrr two
|
96
|
+
rrss two
|
97
|
+
sstt two
|
98
|
+
ttuu two
|
99
|
+
uuvv two
|
100
|
+
vvww two
|
101
|
+
wwxx two
|
102
|
+
xxyy two
|
103
|
+
yyzz two
|
104
|
+
aaaa two
|
105
|
+
|
106
|
+
aaaa three
|
107
|
+
bbbb three
|
108
|
+
|
109
|
+
EOQ
|
110
|
+
)
|