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
109b8ced
Commit
109b8ced
authored
Feb 11, 2014
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix compile error and test failures
parent
e78a2100
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
7 deletions
+14
-7
tests/nghttp2_frame_test.c
tests/nghttp2_frame_test.c
+8
-4
tests/nghttp2_session_test.c
tests/nghttp2_session_test.c
+6
-3
No files found.
tests/nghttp2_frame_test.c
View file @
109b8ced
...
...
@@ -79,6 +79,7 @@ void test_nghttp2_frame_pack_headers()
nghttp2_nv
*
nva
;
ssize_t
nvlen
;
nva_out
out
;
ssize_t
nv_offset
;
nva_out_init
(
&
out
);
nghttp2_hd_deflate_init
(
&
deflater
,
NGHTTP2_HD_SIDE_REQUEST
);
...
...
@@ -102,9 +103,10 @@ void test_nghttp2_frame_pack_headers()
/* We didn't include PRIORITY flag so priority is not packed */
CU_ASSERT
(
1
<<
30
==
oframe
.
pri
);
CU_ASSERT
(
framelen
-
(
ssize_t
)
bufoff
-
8
==
nv_offset
=
bufoff
+
NGHTTP2_FRAME_HEAD_LENGTH
;
CU_ASSERT
(
framelen
-
nv_offset
==
inflate_hd
(
&
inflater
,
&
out
,
buf
+
bufoff
+
8
,
framelen
-
bufoff
-
8
));
buf
+
nv_offset
,
framelen
-
nv_offset
));
CU_ASSERT
(
7
==
out
.
nvlen
);
CU_ASSERT
(
nvnameeq
(
"method"
,
&
out
.
nva
[
0
]));
...
...
@@ -128,8 +130,10 @@ void test_nghttp2_frame_pack_headers()
1000000007
,
&
oframe
.
hd
);
CU_ASSERT
(
1
<<
20
==
oframe
.
pri
);
CU_ASSERT
(
framelen
-
12
==
inflate_hd
(
&
inflater
,
&
out
,
buf
+
12
,
framelen
-
12
));
nv_offset
=
bufoff
+
NGHTTP2_FRAME_HEAD_LENGTH
+
4
;
CU_ASSERT
(
framelen
-
nv_offset
==
inflate_hd
(
&
inflater
,
&
out
,
buf
+
nv_offset
,
framelen
-
nv_offset
));
nghttp2_nv_array_sort
(
out
.
nva
,
out
.
nvlen
);
CU_ASSERT
(
nvnameeq
(
"method"
,
&
out
.
nva
[
0
]));
...
...
tests/nghttp2_session_test.c
View file @
109b8ced
...
...
@@ -797,6 +797,7 @@ void test_nghttp2_session_recv_premature_headers(void)
my_user_data
ud
;
nghttp2_hd_deflater
deflater
;
nghttp2_outbound_item
*
item
;
size_t
bufoff
=
0
;
memset
(
&
callbacks
,
0
,
sizeof
(
nghttp2_session_callbacks
));
...
...
@@ -808,14 +809,16 @@ void test_nghttp2_session_recv_premature_headers(void)
nghttp2_frame_headers_init
(
&
frame
.
headers
,
NGHTTP2_FLAG_END_HEADERS
,
1
,
NGHTTP2_PRI_DEFAULT
,
nva
,
nvlen
);
framedatalen
=
nghttp2_frame_pack_headers
(
&
framedata
,
&
framedatacap
,
&
bufoff
,
&
frame
.
headers
,
&
deflater
);
nghttp2_frame_headers_free
(
&
frame
.
headers
);
/* Intentionally feed payload cutting last 1 byte off */
nghttp2_put_uint16be
(
framedata
,
frame
.
hd
.
length
-
1
);
rv
=
nghttp2_session_mem_recv
(
session
,
framedata
,
framedatalen
-
1
);
CU_ASSERT
((
ssize_t
)
framedatalen
-
1
==
rv
);
nghttp2_put_uint16be
(
framedata
+
bufoff
,
frame
.
hd
.
length
-
1
);
rv
=
nghttp2_session_mem_recv
(
session
,
framedata
+
bufoff
,
framedatalen
-
bufoff
-
1
);
CU_ASSERT
((
ssize_t
)
framedatalen
-
bufoff
-
1
==
rv
);
item
=
nghttp2_session_get_next_ob_item
(
session
);
CU_ASSERT
(
NULL
!=
item
);
...
...
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