From 0f4d01c25c44e3b82efa344fda8678105c244d08 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Thu, 3 Jul 2014 23:00:19 +0900 Subject: [PATCH] nghttpx: Pass through NGHTTP2_NO_ERROR from downstream to upstream --- src/shrpx_http2_upstream.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/shrpx_http2_upstream.cc b/src/shrpx_http2_upstream.cc index 7b7789d8..a0c88a0f 100644 --- a/src/shrpx_http2_upstream.cc +++ b/src/shrpx_http2_upstream.cc @@ -539,12 +539,14 @@ namespace { nghttp2_error_code infer_upstream_rst_stream_error_code (nghttp2_error_code downstream_error_code) { - // Only propagate NGHTTP2_REFUSED_STREAM so that upstream client - // can resend request. - if(downstream_error_code != NGHTTP2_REFUSED_STREAM) { - return NGHTTP2_INTERNAL_ERROR; - } else { + // NGHTTP2_REFUSED_STREAM is important because it tells upstream + // client to retry. + switch(downstream_error_code) { + case NGHTTP2_NO_ERROR: + case NGHTTP2_REFUSED_STREAM: return downstream_error_code; + default: + return NGHTTP2_INTERNAL_ERROR; } } } // namespace