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
9c4c99bf
Commit
9c4c99bf
authored
Apr 02, 2014
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adjust transmission frame buffer size to support maximum payload size
parent
9d9eb482
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
19 deletions
+14
-19
lib/nghttp2_frame.h
lib/nghttp2_frame.h
+10
-12
lib/nghttp2_session.c
lib/nghttp2_session.c
+2
-5
tests/nghttp2_session_test.c
tests/nghttp2_session_test.c
+2
-2
No files found.
lib/nghttp2_frame.h
View file @
9c4c99bf
...
...
@@ -43,18 +43,16 @@
/* The number of bytes of frame header. */
#define NGHTTP2_FRAME_HDLEN 8
/* The maximum frame and payload length. The spec allows maximum
payload length up to 16383 bytes. Due to efficient buffer
allocation, we choose smaller buffer. Actual payload limit offsets
frame header and possible PAD_HIGH and PAD_LOW to ease
serialization and save memcopying. */
#define NGHTTP2_MAX_FRAMELEN 8192
#define NGHTTP2_MAX_PAYLOADLEN (NGHTTP2_MAX_FRAMELEN - NGHTTP2_FRAME_HDLEN - 2)
/* The maximum length of DATA frame payload. To fit entire DATA frame
into 4096K buffer, we use subtract header size (8 bytes) + 2 bytes
padding. See nghttp2_session_pack_data(). */
#define NGHTTP2_DATA_PAYLOAD_LENGTH (4096 - NGHTTP2_FRAME_HDLEN - 2)
#define NGHTTP2_MAX_PAYLOADLEN 16383
/* The one frame buffer length for tranmission. We may use several of
them to support CONTINUATION. To account for padding specifiers
(PAD_HIGH and PAD_LOW), we allocate extra 2 bytes, which saves
extra large memcopying. */
#define NGHTTP2_FRAMEBUF_CHUNKLEN \
(NGHTTP2_FRAME_HDLEN + 2 + NGHTTP2_MAX_PAYLOADLEN)
/* The maximum length of DATA frame payload. */
#define NGHTTP2_DATA_PAYLOAD_LENGTH 4096
/* The number of bytes for each SETTINGS entry */
#define NGHTTP2_FRAME_SETTINGS_ENTRY_LENGTH 5
...
...
lib/nghttp2_session.c
View file @
9c4c99bf
...
...
@@ -321,12 +321,9 @@ static int nghttp2_session_new(nghttp2_session **session_ptr,
(
*
session_ptr
)
->
server
=
1
;
}
/* 2 for PAD_HIGH and PAD_LOW. We have maximum 64KB of frame
serialization buffer for transmission */
/* 2 for PAD_HIGH and PAD_LOW. */
rv
=
nghttp2_bufs_init3
(
&
(
*
session_ptr
)
->
aob
.
framebufs
,
NGHTTP2_MAX_FRAMELEN
,
(
1
<<
17
)
/
NGHTTP2_MAX_FRAMELEN
,
(
1
<<
13
)
/
NGHTTP2_MAX_FRAMELEN
,
NGHTTP2_FRAMEBUF_CHUNKLEN
,
8
,
1
,
NGHTTP2_FRAME_HDLEN
+
2
);
if
(
rv
!=
0
)
{
goto
fail_aob_framebuf
;
...
...
tests/nghttp2_session_test.c
View file @
9c4c99bf
...
...
@@ -4659,7 +4659,7 @@ void test_nghttp2_session_pack_headers_with_padding(void)
accumulator acc;
my_user_data ud;
nghttp2_session_callbacks callbacks;
nghttp2_nv
nva
[
4086
];
nghttp2_nv nva[
8172
];
size_t i;
nghttp2_priority_spec pri_spec;
...
...
@@ -4725,7 +4725,7 @@ void test_nghttp2_session_pack_headers_with_padding2(void)
accumulator acc;
my_user_data ud;
nghttp2_session_callbacks callbacks;
nghttp2_nv
nva
[
8182
];
nghttp2_nv nva[
16364
];
size_t i;
for(i = 0; i < ARRLEN(nva); ++i) {
...
...
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