Retain stream in reserved state on client side

Application may use it using nghttp2_stream_* functions, and traverse
its dependency.
This commit is contained in:
Tatsuhiro Tsujikawa 2015-11-27 22:54:55 +09:00
parent f23e34fa3c
commit a70445e122
2 changed files with 1 additions and 10 deletions

View File

@ -973,15 +973,6 @@ nghttp2_stream *nghttp2_session_open_stream(nghttp2_session *session,
} }
} }
/* We don't have to track dependency of received reserved stream */
if (stream->shut_flags & NGHTTP2_SHUT_WR) {
return stream;
}
/* TODO Client does not have to track dependencies of streams except
for those which have upload data. Currently, we just track
everything. */
if (pri_spec->stream_id == 0) { if (pri_spec->stream_id == 0) {
dep_stream = &session->root; dep_stream = &session->root;
} }

View File

@ -4886,7 +4886,7 @@ void test_nghttp2_session_open_stream(void) {
NGHTTP2_STREAM_RESERVED, NULL); NGHTTP2_STREAM_RESERVED, NULL);
CU_ASSERT(0 == session->num_incoming_streams); CU_ASSERT(0 == session->num_incoming_streams);
CU_ASSERT(0 == session->num_outgoing_streams); CU_ASSERT(0 == session->num_outgoing_streams);
CU_ASSERT(NULL == stream->dep_prev); CU_ASSERT(&session->root == stream->dep_prev);
CU_ASSERT(NGHTTP2_DEFAULT_WEIGHT == stream->weight); CU_ASSERT(NGHTTP2_DEFAULT_WEIGHT == stream->weight);
CU_ASSERT(NGHTTP2_SHUT_WR == stream->shut_flags); CU_ASSERT(NGHTTP2_SHUT_WR == stream->shut_flags);