mirror of
https://github.com/nghttp2/nghttp2.git
synced 2025-12-10 03:58:53 +08:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user