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
743fc4a3
Commit
743fc4a3
authored
Sep 11, 2016
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use the similar naming scheme for table size as
392256e5
parent
392256e5
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
32 deletions
+34
-32
lib/includes/nghttp2/nghttp2.h
lib/includes/nghttp2/nghttp2.h
+19
-17
lib/nghttp2_hd.c
lib/nghttp2_hd.c
+13
-13
lib/nghttp2_hd.h
lib/nghttp2_hd.h
+2
-2
No files found.
lib/includes/nghttp2/nghttp2.h
View file @
743fc4a3
...
...
@@ -4596,7 +4596,7 @@ typedef struct nghttp2_hd_deflater nghttp2_hd_deflater;
*
* Initializes |*deflater_ptr| for deflating name/values pairs.
*
* The |
deflate_hd_table_bufsize_max
| is the upper bound of header
* The |
max_deflate_dynamic_table_size
| is the upper bound of header
* table size the deflater will use.
*
* If this function fails, |*deflater_ptr| is left untouched.
...
...
@@ -4607,8 +4607,9 @@ typedef struct nghttp2_hd_deflater nghttp2_hd_deflater;
* :enum:`NGHTTP2_ERR_NOMEM`
* Out of memory.
*/
NGHTTP2_EXTERN
int
nghttp2_hd_deflate_new
(
nghttp2_hd_deflater
**
deflater_ptr
,
size_t
deflate_hd_table_bufsize_max
);
NGHTTP2_EXTERN
int
nghttp2_hd_deflate_new
(
nghttp2_hd_deflater
**
deflater_ptr
,
size_t
max_deflate_dynamic_table_size
);
/**
* @function
...
...
@@ -4625,8 +4626,9 @@ NGHTTP2_EXTERN int nghttp2_hd_deflate_new(nghttp2_hd_deflater **deflater_ptr,
* The library code does not refer to |mem| pointer after this
* function returns, so the application can safely free it.
*/
NGHTTP2_EXTERN
int
nghttp2_hd_deflate_new2
(
nghttp2_hd_deflater
**
deflater_ptr
,
size_t
deflate_hd_table_bufsize_max
,
NGHTTP2_EXTERN
int
nghttp2_hd_deflate_new2
(
nghttp2_hd_deflater
**
deflater_ptr
,
size_t
max_deflate_dynamic_table_size
,
nghttp2_mem
*
mem
);
/**
...
...
@@ -4640,18 +4642,18 @@ NGHTTP2_EXTERN void nghttp2_hd_deflate_del(nghttp2_hd_deflater *deflater);
* @function
*
* Changes header table size of the |deflater| to
* |settings_
hd_table_bufsize_max
| bytes. This may trigger eviction
* |settings_
max_dynamic_table_size
| bytes. This may trigger eviction
* in the dynamic table.
*
* The |settings_
hd_table_bufsize_max| should be the value received in
* SETTINGS_HEADER_TABLE_SIZE.
* The |settings_
max_dynamic_table_size| should be the value received
*
in
SETTINGS_HEADER_TABLE_SIZE.
*
* The deflater never uses more memory than
* ``
deflate_hd_table_bufsize_max
`` bytes specified in
* ``
max_deflate_dynamic_table_size
`` bytes specified in
* `nghttp2_hd_deflate_new()`. Therefore, if
* |settings_
hd_table_bufsize_max| > ``deflate_hd_table_bufsize_max``,
*
resulting maximum table size becomes
*
``deflate_hd_table_bufsize_max
``.
* |settings_
max_dynamic_table_size| >
*
``max_deflate_dynamic_table_size``, resulting maximum table size
*
becomes ``max_deflate_dynamic_table_size
``.
*
* This function returns 0 if it succeeds, or one of the following
* negative error codes:
...
...
@@ -4661,7 +4663,7 @@ NGHTTP2_EXTERN void nghttp2_hd_deflate_del(nghttp2_hd_deflater *deflater);
*/
NGHTTP2_EXTERN
int
nghttp2_hd_deflate_change_table_size
(
nghttp2_hd_deflater
*
deflater
,
size_t
settings_
hd_table_bufsize_max
);
size_t
settings_
max_dynamic_table_size
);
/**
* @function
...
...
@@ -4832,8 +4834,8 @@ NGHTTP2_EXTERN void nghttp2_hd_inflate_del(nghttp2_hd_inflater *inflater);
* Changes header table size in the |inflater|. This may trigger
* eviction in the dynamic table.
*
* The |settings_
hd_table_bufsize_max| should be the value transmitted
* in SETTINGS_HEADER_TABLE_SIZE.
* The |settings_
max_dynamic_table_size| should be the value
*
transmitted
in SETTINGS_HEADER_TABLE_SIZE.
*
* This function must not be called while header block is being
* inflated. In other words, this function must be called after
...
...
@@ -4854,7 +4856,7 @@ NGHTTP2_EXTERN void nghttp2_hd_inflate_del(nghttp2_hd_inflater *inflater);
*/
NGHTTP2_EXTERN
int
nghttp2_hd_inflate_change_table_size
(
nghttp2_hd_inflater
*
inflater
,
size_t
settings_
hd_table_bufsize_max
);
size_t
settings_
max_dynamic_table_size
);
/**
* @enum
...
...
lib/nghttp2_hd.c
View file @
743fc4a3
...
...
@@ -684,7 +684,7 @@ int nghttp2_hd_deflate_init(nghttp2_hd_deflater *deflater, nghttp2_mem *mem) {
}
int
nghttp2_hd_deflate_init2
(
nghttp2_hd_deflater
*
deflater
,
size_t
deflate_hd_table_bufsize_max
,
size_t
max_deflate_dynamic_table_size
,
nghttp2_mem
*
mem
)
{
int
rv
;
rv
=
hd_context_init
(
&
deflater
->
ctx
,
mem
);
...
...
@@ -694,14 +694,14 @@ int nghttp2_hd_deflate_init2(nghttp2_hd_deflater *deflater,
hd_map_init
(
&
deflater
->
map
);
if
(
deflate_hd_table_bufsize_max
<
NGHTTP2_HD_DEFAULT_MAX_BUFFER_SIZE
)
{
if
(
max_deflate_dynamic_table_size
<
NGHTTP2_HD_DEFAULT_MAX_BUFFER_SIZE
)
{
deflater
->
notify_table_size_change
=
1
;
deflater
->
ctx
.
hd_table_bufsize_max
=
deflate_hd_table_bufsize_max
;
deflater
->
ctx
.
hd_table_bufsize_max
=
max_deflate_dynamic_table_size
;
}
else
{
deflater
->
notify_table_size_change
=
0
;
}
deflater
->
deflate_hd_table_bufsize_max
=
deflate_hd_table_bufsize_max
;
deflater
->
deflate_hd_table_bufsize_max
=
max_deflate_dynamic_table_size
;
deflater
->
min_hd_table_bufsize_max
=
UINT32_MAX
;
return
0
;
...
...
@@ -1225,9 +1225,9 @@ static void hd_context_shrink_table_size(nghttp2_hd_context *context,
}
}
int
nghttp2_hd_deflate_change_table_size
(
nghttp2_hd_deflater
*
deflater
,
size_t
settings_hd_table_bufsize_max
)
{
size_t
next_bufsize
=
nghttp2_min
(
settings_
hd_table_bufsize_max
,
int
nghttp2_hd_deflate_change_table_size
(
nghttp2_hd_deflater
*
deflater
,
size_t
settings_max_dynamic_table_size
)
{
size_t
next_bufsize
=
nghttp2_min
(
settings_
max_dynamic_table_size
,
deflater
->
deflate_hd_table_bufsize_max
);
deflater
->
ctx
.
hd_table_bufsize_max
=
next_bufsize
;
...
...
@@ -1241,8 +1241,8 @@ int nghttp2_hd_deflate_change_table_size(nghttp2_hd_deflater *deflater,
return
0
;
}
int
nghttp2_hd_inflate_change_table_size
(
nghttp2_hd_inflater
*
inflater
,
size_t
settings_hd_table_bufsize_max
)
{
int
nghttp2_hd_inflate_change_table_size
(
nghttp2_hd_inflater
*
inflater
,
size_t
settings_max_dynamic_table_size
)
{
switch
(
inflater
->
state
)
{
case
NGHTTP2_HD_STATE_EXPECT_TABLE_SIZE
:
case
NGHTTP2_HD_STATE_INFLATE_START
:
...
...
@@ -1258,16 +1258,16 @@ int nghttp2_hd_inflate_change_table_size(nghttp2_hd_inflater *inflater,
strictly smaller than the current negotiated maximum size,
encoder must send dynamic table size update. In other cases, we
cannot expect it to do so. */
if
(
inflater
->
ctx
.
hd_table_bufsize_max
>
settings_
hd_table_bufsize_max
)
{
if
(
inflater
->
ctx
.
hd_table_bufsize_max
>
settings_
max_dynamic_table_size
)
{
inflater
->
state
=
NGHTTP2_HD_STATE_EXPECT_TABLE_SIZE
;
/* Remember minimum value, and validate that encoder sends the
value less than or equal to this. */
inflater
->
min_hd_table_bufsize_max
=
settings_
hd_table_bufsize_max
;
inflater
->
min_hd_table_bufsize_max
=
settings_
max_dynamic_table_size
;
}
inflater
->
settings_hd_table_bufsize_max
=
settings_
hd_table_bufsize_max
;
inflater
->
settings_hd_table_bufsize_max
=
settings_
max_dynamic_table_size
;
inflater
->
ctx
.
hd_table_bufsize_max
=
settings_
hd_table_bufsize_max
;
inflater
->
ctx
.
hd_table_bufsize_max
=
settings_
max_dynamic_table_size
;
hd_context_shrink_table_size
(
&
inflater
->
ctx
,
NULL
);
return
0
;
...
...
lib/nghttp2_hd.h
View file @
743fc4a3
...
...
@@ -288,7 +288,7 @@ int nghttp2_hd_deflate_init(nghttp2_hd_deflater *deflater, nghttp2_mem *mem);
/*
* Initializes |deflater| for deflating name/values pairs.
*
* The encoder only uses up to |
deflate_hd_table_bufsize_max
| bytes
* The encoder only uses up to |
max_deflate_dynamic_table_size
| bytes
* for header table even if the larger value is specified later in
* nghttp2_hd_change_table_size().
*
...
...
@@ -299,7 +299,7 @@ int nghttp2_hd_deflate_init(nghttp2_hd_deflater *deflater, nghttp2_mem *mem);
* Out of memory.
*/
int
nghttp2_hd_deflate_init2
(
nghttp2_hd_deflater
*
deflater
,
size_t
deflate_hd_table_bufsize_max
,
size_t
max_deflate_dynamic_table_size
,
nghttp2_mem
*
mem
);
/*
...
...
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