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
7021a9fc
Commit
7021a9fc
authored
Jul 27, 2013
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Incremental indexing only when the entry size if less than threshold
parent
f74674aa
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
20 deletions
+43
-20
lib/nghttp2_hd.c
lib/nghttp2_hd.c
+42
-20
lib/nghttp2_hd.h
lib/nghttp2_hd.h
+1
-0
No files found.
lib/nghttp2_hd.c
View file @
7021a9fc
...
...
@@ -812,8 +812,11 @@ ssize_t nghttp2_hd_deflate_hd(nghttp2_hd_context *deflater,
/* Check name exists in hd_table */
ent
=
find_name_in_hd_table
(
deflater
,
&
nv
[
i
]);
if
(
ent
)
{
nghttp2_hd_entry
*
new_ent
;
uint8_t
index
=
ent
->
index
;
int
incidx
=
0
;
if
(
entry_room
(
nv
[
i
].
namelen
,
nv
[
i
].
valuelen
)
<
NGHTTP2_HD_MAX_ENTRY_SIZE
)
{
nghttp2_hd_entry
*
new_ent
;
new_ent
=
add_hd_table_incremental
(
deflater
,
&
nv
[
i
]);
if
(
!
new_ent
)
{
rv
=
NGHTTP2_ERR_HEADER_COMP
;
...
...
@@ -823,12 +826,23 @@ ssize_t nghttp2_hd_deflate_hd(nghttp2_hd_context *deflater,
if
(
rv
<
0
)
{
goto
fail
;
}
incidx
=
1
;
}
else
{
rv
=
add_workingset_indname
(
deflater
,
ent
,
nv
[
i
].
value
,
nv
[
i
].
valuelen
);
if
(
rv
<
0
)
{
goto
fail
;
}
}
rv
=
emit_indname_block
(
buf_ptr
,
buflen_ptr
,
&
offset
,
index
,
nv
[
i
].
value
,
nv
[
i
].
valuelen
,
1
);
nv
[
i
].
value
,
nv
[
i
].
valuelen
,
incidx
);
if
(
rv
<
0
)
{
goto
fail
;
}
}
else
{
int
incidx
=
0
;
if
(
entry_room
(
nv
[
i
].
namelen
,
nv
[
i
].
valuelen
)
<
NGHTTP2_HD_MAX_ENTRY_SIZE
)
{
nghttp2_hd_entry
*
new_ent
;
new_ent
=
add_hd_table_incremental
(
deflater
,
&
nv
[
i
]);
if
(
!
new_ent
)
{
...
...
@@ -839,7 +853,15 @@ ssize_t nghttp2_hd_deflate_hd(nghttp2_hd_context *deflater,
if
(
rv
<
0
)
{
goto
fail
;
}
rv
=
emit_newname_block
(
buf_ptr
,
buflen_ptr
,
&
offset
,
&
nv
[
i
],
1
);
incidx
=
1
;
}
else
{
rv
=
add_workingset_newname
(
deflater
,
&
nv
[
i
]);
if
(
rv
<
0
)
{
goto
fail
;
}
}
rv
=
emit_newname_block
(
buf_ptr
,
buflen_ptr
,
&
offset
,
&
nv
[
i
],
incidx
);
if
(
rv
<
0
)
{
goto
fail
;
}
...
...
lib/nghttp2_hd.h
View file @
7021a9fc
...
...
@@ -36,6 +36,7 @@
#define NGHTTP2_INITIAL_WS_SIZE 128
#define NGHTTP2_HD_MAX_BUFFER_SIZE 4096
#define NGHTTP2_HD_MAX_ENTRY_SIZE 1024
#define NGHTTP2_HD_ENTRY_OVERHEAD 32
/* This value is sensible to NGHTTP2_HD_MAX_BUFFER_SIZE. Currently,
...
...
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