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
b71bb6dc
Commit
b71bb6dc
authored
Nov 18, 2013
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
deflatehd: Print overall input, output length and compression ratio
parent
53b3fba0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
hdtest/deflatehd.c
hdtest/deflatehd.c
+7
-0
No files found.
hdtest/deflatehd.c
View file @
b71bb6dc
...
...
@@ -47,6 +47,9 @@ typedef struct {
static
deflate_config
config
;
static
size_t
input_sum
;
static
size_t
output_sum
;
static
void
to_hex
(
char
*
dest
,
const
uint8_t
*
src
,
size_t
len
)
{
size_t
i
;
...
...
@@ -94,6 +97,8 @@ static void deflate_hd(nghttp2_hd_context *deflater,
fprintf
(
stderr
,
"deflate failed with error code %zd at %d
\n
"
,
rv
,
seq
);
exit
(
EXIT_FAILURE
);
}
input_sum
+=
inputlen
;
output_sum
+=
rv
;
output_to_json
(
deflater
,
buf
,
rv
,
inputlen
,
seq
);
nghttp2_hd_end_headers
(
deflater
);
free
(
buf
);
...
...
@@ -379,6 +384,8 @@ int main(int argc, char **argv)
}
else
{
perform
(
&
deflater
);
}
fprintf
(
stderr
,
"Overall: input=%zu output=%zu ratio=%.02f
\n
"
,
input_sum
,
output_sum
,
(
double
)
output_sum
/
input_sum
);
nghttp2_hd_deflate_free
(
&
deflater
);
return
0
;
}
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