Add stream public API

The intention of this stream API is give server application about
stream dependency information, so that it can utilize it for better
scheduling of stream processing.  We have no plan to add object
oriented API based on stream object.
This commit is contained in:
Tatsuhiro Tsujikawa
2015-08-18 22:41:50 +09:00
parent 836b1de0d5
commit 059280d1a5
8 changed files with 474 additions and 8 deletions

View File

@@ -338,8 +338,8 @@ static int session_new(nghttp2_session **session_ptr,
}
nghttp2_stream_init(&(*session_ptr)->root, 0, NGHTTP2_STREAM_FLAG_NONE,
NGHTTP2_STREAM_INITIAL, NGHTTP2_DEFAULT_WEIGHT, 0, 0,
NULL, mem);
NGHTTP2_STREAM_IDLE, NGHTTP2_DEFAULT_WEIGHT, 0, 0, NULL,
mem);
(*session_ptr)->remote_window_size = NGHTTP2_INITIAL_CONNECTION_WINDOW_SIZE;
(*session_ptr)->recv_window_size = 0;
@@ -6527,3 +6527,12 @@ uint32_t nghttp2_session_get_next_stream_id(nghttp2_session *session) {
int32_t nghttp2_session_get_last_proc_stream_id(nghttp2_session *session) {
return session->last_proc_stream_id;
}
nghttp2_stream *nghttp2_session_find_stream(nghttp2_session *session,
int32_t stream_id) {
return nghttp2_session_get_stream_raw(session, stream_id);
}
nghttp2_stream *nghttp2_session_get_root_stream(nghttp2_session *session) {
return &session->root;
}