From 3e72711e23cdaecdb3d82fa7efbb508e8ef1ead0 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Tue, 23 Feb 2016 01:09:45 +0900 Subject: [PATCH] Cap 100 limit for remembering idle streams --- lib/nghttp2_session.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/nghttp2_session.c b/lib/nghttp2_session.c index 69f43d16..944a4790 100644 --- a/lib/nghttp2_session.c +++ b/lib/nghttp2_session.c @@ -1216,11 +1216,12 @@ int nghttp2_session_adjust_idle_stream(nghttp2_session *session) { size_t max; int rv; - /* Make minimum number of idle streams 16, which is arbitrary chosen - number. */ - max = nghttp2_max(16, - nghttp2_min(session->local_settings.max_concurrent_streams, - session->pending_local_max_concurrent_stream)); + /* Make minimum number of idle streams 16, and maximum 100, which + are arbitrary chosen numbers. */ + max = nghttp2_min( + 100, nghttp2_max( + 16, nghttp2_min(session->local_settings.max_concurrent_streams, + session->pending_local_max_concurrent_stream))); DEBUGF(fprintf(stderr, "stream: adjusting kept idle streams " "num_idle_streams=%zu, max=%zu\n",