From a70445e12230217bd7f93bf12b8da67121b3c38f Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 27 Nov 2015 22:54:55 +0900 Subject: [PATCH] Retain stream in reserved state on client side Application may use it using nghttp2_stream_* functions, and traverse its dependency. --- lib/nghttp2_session.c | 9 --------- tests/nghttp2_session_test.c | 2 +- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/lib/nghttp2_session.c b/lib/nghttp2_session.c index be2d3d38..7c6207d7 100644 --- a/lib/nghttp2_session.c +++ b/lib/nghttp2_session.c @@ -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) { dep_stream = &session->root; } diff --git a/tests/nghttp2_session_test.c b/tests/nghttp2_session_test.c index 7a0df3e8..5a6610be 100644 --- a/tests/nghttp2_session_test.c +++ b/tests/nghttp2_session_test.c @@ -4886,7 +4886,7 @@ void test_nghttp2_session_open_stream(void) { NGHTTP2_STREAM_RESERVED, NULL); CU_ASSERT(0 == session->num_incoming_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_SHUT_WR == stream->shut_flags);