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
e693f756
Commit
e693f756
authored
Aug 21, 2016
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add nghttp2_session_get_local_settings() API function
parent
759f6c0b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
0 deletions
+47
-0
doc/Makefile.am
doc/Makefile.am
+1
-0
lib/includes/nghttp2/nghttp2.h
lib/includes/nghttp2/nghttp2.h
+11
-0
lib/nghttp2_session.c
lib/nghttp2_session.c
+20
-0
tests/nghttp2_session_test.c
tests/nghttp2_session_test.c
+15
-0
No files found.
doc/Makefile.am
View file @
e693f756
...
...
@@ -108,6 +108,7 @@ APIDOCS= \
nghttp2_session_get_effective_local_window_size.rst
\
nghttp2_session_get_effective_recv_data_length.rst
\
nghttp2_session_get_last_proc_stream_id.rst
\
nghttp2_session_get_local_settings.rst
\
nghttp2_session_get_local_window_size.rst
\
nghttp2_session_get_next_stream_id.rst
\
nghttp2_session_get_outbound_queue_size.rst
\
...
...
lib/includes/nghttp2/nghttp2.h
View file @
e693f756
...
...
@@ -3242,6 +3242,17 @@ NGHTTP2_EXTERN uint32_t
nghttp2_session_get_remote_settings
(
nghttp2_session
*
session
,
nghttp2_settings_id
id
);
/**
* @function
*
* Returns the value of SETTINGS |id| of local endpoint acknowledged
* by the remote endpoint. The |id| must be one of the values defined
* in :enum:`nghttp2_settings_id`.
*/
NGHTTP2_EXTERN
uint32_t
nghttp2_session_get_local_settings
(
nghttp2_session
*
session
,
nghttp2_settings_id
id
);
/**
* @function
*
...
...
lib/nghttp2_session.c
View file @
e693f756
...
...
@@ -7237,6 +7237,26 @@ uint32_t nghttp2_session_get_remote_settings(nghttp2_session *session,
assert
(
0
);
}
uint32_t
nghttp2_session_get_local_settings
(
nghttp2_session
*
session
,
nghttp2_settings_id
id
)
{
switch
(
id
)
{
case
NGHTTP2_SETTINGS_HEADER_TABLE_SIZE
:
return
session
->
local_settings
.
header_table_size
;
case
NGHTTP2_SETTINGS_ENABLE_PUSH
:
return
session
->
local_settings
.
enable_push
;
case
NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS
:
return
session
->
local_settings
.
max_concurrent_streams
;
case
NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE
:
return
session
->
local_settings
.
initial_window_size
;
case
NGHTTP2_SETTINGS_MAX_FRAME_SIZE
:
return
session
->
local_settings
.
max_frame_size
;
case
NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE
:
return
session
->
local_settings
.
max_header_list_size
;
}
assert
(
0
);
}
static
int
nghttp2_session_upgrade_internal
(
nghttp2_session
*
session
,
const
uint8_t
*
settings_payload
,
size_t
settings_payloadlen
,
...
...
tests/nghttp2_session_test.c
View file @
e693f756
...
...
@@ -5112,6 +5112,15 @@ void test_nghttp2_submit_settings(void) {
CU_ASSERT
(
50
==
session
->
pending_local_max_concurrent_stream
);
/* before receiving SETTINGS ACK, local settings have still default
values */
CU_ASSERT
(
NGHTTP2_DEFAULT_MAX_CONCURRENT_STREAMS
==
nghttp2_session_get_local_settings
(
session
,
NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS
));
CU_ASSERT
(
NGHTTP2_INITIAL_WINDOW_SIZE
==
nghttp2_session_get_local_settings
(
session
,
NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE
));
nghttp2_frame_settings_init
(
&
ack_frame
.
settings
,
NGHTTP2_FLAG_ACK
,
NULL
,
0
);
CU_ASSERT
(
0
==
nghttp2_session_on_settings_received
(
session
,
&
ack_frame
,
0
));
nghttp2_frame_settings_free
(
&
ack_frame
.
settings
,
mem
);
...
...
@@ -5120,6 +5129,12 @@ void test_nghttp2_submit_settings(void) {
CU_ASSERT
(
1023
==
session
->
hd_inflater
.
ctx
.
hd_table_bufsize_max
);
CU_ASSERT
(
111
==
session
->
hd_inflater
.
min_hd_table_bufsize_max
);
CU_ASSERT
(
50
==
session
->
local_settings
.
max_concurrent_streams
);
CU_ASSERT
(
50
==
nghttp2_session_get_local_settings
(
session
,
NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS
));
CU_ASSERT
(
16
*
1024
==
nghttp2_session_get_local_settings
(
session
,
NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE
));
/* We just keep the last seen value */
CU_ASSERT
(
50
==
session
->
pending_local_max_concurrent_stream
);
...
...
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