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
764cd173
Commit
764cd173
authored
Jul 08, 2015
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test when nghttp2_http_on_data_chunk failed without auto flow control
parent
c70cfe64
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
tests/nghttp2_session_test.c
tests/nghttp2_session_test.c
+22
-0
No files found.
tests/nghttp2_session_test.c
View file @
764cd173
...
...
@@ -810,6 +810,7 @@ void test_nghttp2_session_recv_data_no_auto_flow_control(void) {
uint8_t
data
[
8192
];
ssize_t
rv
;
size_t
sendlen
;
nghttp2_stream
*
stream
;
memset
(
&
callbacks
,
0
,
sizeof
(
nghttp2_session_callbacks
));
callbacks
.
send_callback
=
null_send_callback
;
...
...
@@ -838,6 +839,9 @@ void test_nghttp2_session_recv_data_no_auto_flow_control(void) {
rv
=
nghttp2_session_mem_recv
(
session
,
data
,
sendlen
);
CU_ASSERT
((
ssize_t
)
sendlen
==
rv
);
/* We consumed pad length field (1 byte) */
CU_ASSERT
(
1
==
session
->
consumed_size
);
/* close stream here */
nghttp2_submit_rst_stream
(
session
,
NGHTTP2_FLAG_NONE
,
1
,
NGHTTP2_NO_ERROR
);
nghttp2_session_send
(
session
);
...
...
@@ -852,6 +856,24 @@ void test_nghttp2_session_recv_data_no_auto_flow_control(void) {
CU_ASSERT
((
int32_t
)(
NGHTTP2_FRAME_HDLEN
+
hd
.
length
-
sendlen
+
1
)
==
session
->
consumed_size
);
nghttp2_session_del
(
session
);
/* Reuse DATA created previously. */
nghttp2_session_server_new2
(
&
session
,
&
callbacks
,
&
ud
,
option
);
/* Now we are expecting final response header, which means receiving
DATA for that stream is illegal. */
stream
=
open_stream
(
session
,
1
);
stream
->
http_flags
|=
NGHTTP2_HTTP_FLAG_EXPECT_FINAL_RESPONSE
;
rv
=
nghttp2_session_mem_recv
(
session
,
data
,
NGHTTP2_FRAME_HDLEN
+
hd
.
length
);
CU_ASSERT
((
ssize_t
)(
NGHTTP2_FRAME_HDLEN
+
hd
.
length
)
==
rv
);
/* Whole payload must be consumed now because HTTP messaging rule
was not honored. */
CU_ASSERT
((
int32_t
)
hd
.
length
==
session
->
consumed_size
);
nghttp2_session_del
(
session
);
nghttp2_option_del
(
option
);
}
...
...
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