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
c411d169
Commit
c411d169
authored
Apr 07, 2018
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix frame handling
parent
6e744662
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
0 deletions
+28
-0
lib/nghttp2_frame.c
lib/nghttp2_frame.c
+3
-0
tests/nghttp2_session_test.c
tests/nghttp2_session_test.c
+25
-0
No files found.
lib/nghttp2_frame.c
View file @
c411d169
...
...
@@ -215,6 +215,9 @@ void nghttp2_frame_altsvc_free(nghttp2_extension *frame, nghttp2_mem *mem) {
nghttp2_ext_altsvc
*
altsvc
;
altsvc
=
frame
->
payload
;
if
(
altsvc
==
NULL
)
{
return
;
}
/* We use the same buffer for altsvc->origin and
altsvc->field_value. */
nghttp2_mem_free
(
mem
,
altsvc
->
origin
);
...
...
tests/nghttp2_session_test.c
View file @
c411d169
...
...
@@ -2297,6 +2297,31 @@ void test_nghttp2_session_recv_altsvc(void) {
nghttp2_session_del
(
session
);
/* send too large frame */
nghttp2_buf_reset
(
&
buf
);
nghttp2_session_client_new2
(
&
session
,
&
callbacks
,
&
ud
,
option
);
session
->
local_settings
.
max_frame_size
=
NGHTTP2_MAX_FRAME_SIZE_MIN
-
1
;
nghttp2_frame_hd_init
(
&
hd
,
NGHTTP2_MAX_FRAME_SIZE_MIN
+
1
,
NGHTTP2_ALTSVC
,
NGHTTP2_FLAG_NONE
,
0
);
nghttp2_frame_pack_frame_hd
(
buf
.
last
,
&
hd
);
buf
.
last
+=
NGHTTP2_FRAME_HDLEN
;
nghttp2_put_uint16be
(
buf
.
last
,
sizeof
(
origin
)
-
1
);
buf
.
last
+=
2
;
buf
.
last
=
nghttp2_cpymem
(
buf
.
last
,
origin
,
sizeof
(
origin
)
-
1
);
memset
(
buf
.
last
,
0
,
nghttp2_buf_avail
(
&
buf
));
buf
.
last
+=
nghttp2_buf_avail
(
&
buf
);
ud
.
frame_recv_cb_called
=
0
;
rv
=
nghttp2_session_mem_recv
(
session
,
buf
.
pos
,
nghttp2_buf_len
(
&
buf
));
CU_ASSERT
((
ssize_t
)
nghttp2_buf_len
(
&
buf
)
==
rv
);
CU_ASSERT
(
0
==
ud
.
frame_recv_cb_called
);
nghttp2_session_del
(
session
);
/* received by server */
nghttp2_buf_reset
(
&
buf
);
...
...
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