Fix bug that nghttp2_session_find_stream(session, 0) returned NULL

Previously, nghttp2_session_find_stream(session, 0) returned NULL
despite the fact that documentation said that it should return root
stream.  Now it is corrected, and it returns root stream as
documented.
This commit is contained in:
Tatsuhiro Tsujikawa
2015-11-24 22:30:12 +09:00
parent c44ee44cc3
commit b53b1381b7
4 changed files with 35 additions and 0 deletions

View File

@@ -6768,6 +6768,10 @@ int32_t nghttp2_session_get_last_proc_stream_id(nghttp2_session *session) {
nghttp2_stream *nghttp2_session_find_stream(nghttp2_session *session,
int32_t stream_id) {
if (stream_id == 0) {
return &session->root;
}
return nghttp2_session_get_stream_raw(session, stream_id);
}