Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
4fdc274a
Commit
4fdc274a
authored
Jun 18, 2014
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
python: Add -c, --simulate-table-size-change option to hpackmake.py
parent
2d18a073
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
2 deletions
+21
-2
python/hpackmake.py
python/hpackmake.py
+21
-2
No files found.
python/hpackmake.py
View file @
4fdc274a
...
...
@@ -13,7 +13,8 @@ import sys, base64, json, os.path, os, argparse, errno
from
binascii
import
b2a_hex
import
nghttp2
def
testsuite
(
testdata
,
filename
,
outdir
,
table_size
,
deflate_table_size
):
def
testsuite
(
testdata
,
filename
,
outdir
,
table_size
,
deflate_table_size
,
simulate_table_size_change
):
res
=
{
'draft'
:
8
,
'description'
:
'''
\
...
...
@@ -29,11 +30,24 @@ result in less bits on the wire.'''
if
table_size
!=
nghttp2
.
DEFAULT_HEADER_TABLE_SIZE
:
deflater
.
change_table_size
(
table_size
)
num_item
=
len
(
testdata
[
'cases'
])
change_points
=
{}
if
simulate_table_size_change
and
num_item
>
1
:
change_points
[
num_item
*
2
//
3
]
=
table_size
*
2
//
3
change_points
[
num_item
//
3
]
=
table_size
//
3
for
casenum
,
item
in
enumerate
(
testdata
[
'cases'
]):
outitem
=
{
'seqno'
:
casenum
,
'headers'
:
item
[
'headers'
]
}
if
casenum
in
change_points
:
new_table_size
=
change_points
[
casenum
]
deflater
.
change_table_size
(
new_table_size
)
outitem
[
'header_table_size'
]
=
new_table_size
casenum
+=
1
hdrs
=
[(
list
(
x
.
keys
())[
0
].
encode
(
'utf-8'
),
list
(
x
.
values
())[
0
].
encode
(
'utf-8'
))
\
...
...
@@ -57,6 +71,10 @@ if __name__ == '__main__':
ap
.
add_argument
(
'-S'
,
'--deflate-table-size'
,
help
=
'max header table size for deflater'
,
type
=
int
,
default
=
nghttp2
.
DEFLATE_MAX_HEADER_TABLE_SIZE
)
ap
.
add_argument
(
'-c'
,
'--simulate-table-size-change'
,
help
=
'simulate table size change scenario'
,
action
=
'store_true'
)
ap
.
add_argument
(
'file'
,
nargs
=
'*'
,
help
=
'input file'
)
args
=
ap
.
parse_args
()
try
:
...
...
@@ -69,4 +87,5 @@ if __name__ == '__main__':
with
open
(
filename
)
as
f
:
input
=
f
.
read
()
testsuite
(
json
.
loads
(
input
),
os
.
path
.
basename
(
filename
),
args
.
dir
,
args
.
table_size
,
args
.
deflate_table_size
)
args
.
dir
,
args
.
table_size
,
args
.
deflate_table_size
,
args
.
simulate_table_size_change
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment