nghttpx: Don't share session which is already in draining state

This commit is contained in:
Tatsuhiro Tsujikawa 2016-02-28 12:41:34 +09:00
parent 36f6a009b8
commit e7601cde8a
1 changed files with 6 additions and 3 deletions

View File

@ -2045,9 +2045,12 @@ bool Http2Session::max_concurrency_reached(size_t extra) const {
return dconns_.size() + extra >= 100;
}
return dconns_.size() + extra >=
nghttp2_session_get_remote_settings(
session_, NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS);
// If session does not allow further requests, it effectively means
// that maximum concurrency is reached.
return !nghttp2_session_check_request_allowed(session_) ||
dconns_.size() + extra >=
nghttp2_session_get_remote_settings(
session_, NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS);
}
DownstreamAddrGroup *Http2Session::get_downstream_addr_group() const {