Add nghttp2_session_get_stream_remote_window_size public API function

This commit is contained in:
Tatsuhiro Tsujikawa 2014-03-22 00:34:25 +09:00
parent fac42788bc
commit 1dfe2f8670
2 changed files with 25 additions and 0 deletions

View File

@ -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
*

View File

@ -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,