Commit 1dfe2f86 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

Add nghttp2_session_get_stream_remote_window_size public API function

parent fac42788
......@@ -1766,6 +1766,18 @@ int32_t nghttp2_session_get_effective_recv_data_length
int32_t nghttp2_session_get_effective_local_window_size
(nghttp2_session *session);
/**
* @function
*
* Returns the remote window size for a given stream |stream_id|.
* This is the amount of flow-controlled payload (e.g., DATA) that the
* local endpoint can send without WINDOW_UPDATE.
*
* This function returns -1 if it fails.
*/
int32_t nghttp2_session_get_stream_remote_window_size(nghttp2_session* session,
int32_t stream_id);
/**
* @function
*
......
......@@ -4666,6 +4666,19 @@ int32_t nghttp2_session_get_effective_local_window_size
return session->local_window_size;
}
int32_t nghttp2_session_get_stream_remote_window_size(nghttp2_session* session,
int32_t stream_id)
{
nghttp2_stream *stream;
stream = nghttp2_session_get_stream(session, stream_id);
if(stream == NULL) {
return -1;
}
return nghttp2_session_next_data_read(session, stream);
}
int nghttp2_session_upgrade(nghttp2_session *session,
const uint8_t *settings_payload,
size_t settings_payloadlen,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment