mirror of
https://github.com/nghttp2/nghttp2.git
synced 2025-12-07 10:38:53 +08:00
Add nghttp2_session_consume() API
Reworked no automatic WINDOW_UPDATE feature. We added new API nghttp2_session_consume() which tells the library how many bytes are consumed by the application. Instead of submitting WINDOW_UPDATE by the application, the library is now responsible to submit WINDOW_UPDATE based on consumed bytes. This is more reliable method, since it enables us to properly send WINDOW_UPDATE for stream and connection individually. The previous implementation of nghttpx had broken connection window management.
This commit is contained in:
@@ -4762,25 +4762,13 @@ void test_nghttp2_session_set_option(void)
|
||||
|
||||
nghttp2_option_new(&option);
|
||||
|
||||
nghttp2_option_set_no_auto_stream_window_update(option, 1);
|
||||
nghttp2_option_set_no_auto_window_update(option, 1);
|
||||
|
||||
memset(&callbacks, 0, sizeof(nghttp2_session_callbacks));
|
||||
nghttp2_session_client_new2(&session, &callbacks, NULL, option);
|
||||
|
||||
CU_ASSERT(session->opt_flags & NGHTTP2_OPTMASK_NO_AUTO_STREAM_WINDOW_UPDATE);
|
||||
CU_ASSERT(!(session->opt_flags &
|
||||
NGHTTP2_OPTMASK_NO_AUTO_CONNECTION_WINDOW_UPDATE));
|
||||
nghttp2_session_del(session);
|
||||
CU_ASSERT(session->opt_flags & NGHTTP2_OPTMASK_NO_AUTO_WINDOW_UPDATE);
|
||||
|
||||
nghttp2_option_set_no_auto_stream_window_update(option, 0);
|
||||
nghttp2_option_set_no_auto_connection_window_update(option, 1);
|
||||
|
||||
nghttp2_session_server_new2(&session, &callbacks, NULL, option);
|
||||
|
||||
CU_ASSERT(!(session->opt_flags &
|
||||
NGHTTP2_OPTMASK_NO_AUTO_STREAM_WINDOW_UPDATE));
|
||||
CU_ASSERT(session->opt_flags &
|
||||
NGHTTP2_OPTMASK_NO_AUTO_CONNECTION_WINDOW_UPDATE);
|
||||
nghttp2_session_del(session);
|
||||
|
||||
nghttp2_option_set_peer_max_concurrent_streams(option, 100);
|
||||
|
||||
Reference in New Issue
Block a user