From 0d4120ce2ce35a04199bc1a37b90aa5bc0123c1e Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 13 Oct 2014 21:13:45 +0900 Subject: [PATCH] nghttpx: Apply same fix from a225bb2 to spdy upstream --- src/shrpx_spdy_upstream.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/shrpx_spdy_upstream.cc b/src/shrpx_spdy_upstream.cc index bbfbcfa8..51b1e2b3 100644 --- a/src/shrpx_spdy_upstream.cc +++ b/src/shrpx_spdy_upstream.cc @@ -254,6 +254,18 @@ void SpdyUpstream::maintain_downstream_concurrency() { while(get_config()->max_downstream_connections > downstream_queue_.num_active()) { + if(downstream_queue_.pending_empty()) { + break; + } + + { + auto downstream = downstream_queue_.pending_top(); + if(downstream->get_request_state() != Downstream::HEADER_COMPLETE && + downstream->get_request_state() != Downstream::MSG_COMPLETE) { + break; + } + } + auto downstream = downstream_queue_.pop_pending(); if(!downstream) {