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
3d1b4118
Commit
3d1b4118
authored
Feb 27, 2012
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added test for negative window_size case
parent
2b785868
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
1 deletion
+31
-1
tests/spdylay_session_test.c
tests/spdylay_session_test.c
+31
-1
No files found.
tests/spdylay_session_test.c
View file @
3d1b4118
...
...
@@ -1545,6 +1545,8 @@ void test_spdylay_session_flow_control()
my_user_data
ud
;
spdylay_data_provider
data_prd
;
spdylay_frame
frame
;
spdylay_stream
*
stream
;
int32_t
new_initial_window_size
;
memset
(
&
callbacks
,
0
,
sizeof
(
spdylay_session_callbacks
));
callbacks
.
send_callback
=
null_send_callback
;
...
...
@@ -1554,6 +1556,7 @@ void test_spdylay_session_flow_control()
ud
.
ctrl_send_cb_called
=
0
;
ud
.
data_source_length
=
128
*
1024
;
/* Initial window size is 64KiB */
spdylay_session_client_new
(
&
session
,
SPDYLAY_PROTO_SPDY3
,
&
callbacks
,
&
ud
);
spdylay_submit_request
(
session
,
3
,
nv
,
&
data_prd
,
NULL
);
...
...
@@ -1561,6 +1564,7 @@ void test_spdylay_session_flow_control()
CU_ASSERT
(
0
==
spdylay_session_send
(
session
));
CU_ASSERT
(
64
*
1024
==
ud
.
data_source_length
);
/* Back 32KiB */
spdylay_frame_window_update_init
(
&
frame
.
window_update
,
SPDYLAY_PROTO_SPDY3
,
1
,
32
*
1024
);
spdylay_session_on_window_update_received
(
session
,
&
frame
);
...
...
@@ -1569,9 +1573,35 @@ void test_spdylay_session_flow_control()
CU_ASSERT
(
0
==
spdylay_session_send
(
session
));
CU_ASSERT
(
32
*
1024
==
ud
.
data_source_length
);
stream
=
spdylay_session_get_stream
(
session
,
1
);
/* Change initial window size to 16KiB. The window_size becomes
negative. */
new_initial_window_size
=
16
*
1024
;
stream
->
window_size
=
new_initial_window_size
-
(
stream
->
initial_window_size
-
stream
->
window_size
);
CU_ASSERT
(
-
48
*
1024
==
stream
->
window_size
);
/* Back 48KiB */
frame
.
window_update
.
delta_window_size
=
48
*
1024
;
spdylay_session_on_window_update_received
(
session
,
&
frame
);
/* Sends another 32KiB data */
/* Nothing is sent because window_size is less than 0 */
CU_ASSERT
(
0
==
spdylay_session_send
(
session
));
CU_ASSERT
(
32
*
1024
==
ud
.
data_source_length
);
/* Back 16KiB */
frame
.
window_update
.
delta_window_size
=
16
*
1024
;
spdylay_session_on_window_update_received
(
session
,
&
frame
);
/* Sends another 16KiB data */
CU_ASSERT
(
0
==
spdylay_session_send
(
session
));
CU_ASSERT
(
16
*
1024
==
ud
.
data_source_length
);
/* Back 16KiB */
frame
.
window_update
.
delta_window_size
=
16
*
1024
;
spdylay_session_on_window_update_received
(
session
,
&
frame
);
/* Sends another 16KiB data */
CU_ASSERT
(
0
==
spdylay_session_send
(
session
));
CU_ASSERT
(
0
==
ud
.
data_source_length
);
CU_ASSERT
(
spdylay_session_get_stream
(
session
,
1
)
->
shut_flags
&
...
...
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