From 3c393dca586aec9eb2fc38c1db32af90ffb50de4 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Thu, 15 Nov 2018 10:14:40 +0900 Subject: [PATCH] nghttpx: Fix assertion failure on mruby send_info with HTTP/1 frontend --- src/shrpx_https_upstream.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/shrpx_https_upstream.cc b/src/shrpx_https_upstream.cc index 35486dde..a738707e 100644 --- a/src/shrpx_https_upstream.cc +++ b/src/shrpx_https_upstream.cc @@ -1049,7 +1049,7 @@ int HttpsUpstream::on_downstream_header_complete(Downstream *downstream) { auto &resp = downstream->response(); auto &balloc = downstream->get_block_allocator(); auto dconn = downstream->get_downstream_connection(); - assert(dconn); + // dconn might be nullptr if this is non-final response from mruby. if (downstream->get_non_final_response() && !downstream->supports_non_final_response()) { @@ -1059,6 +1059,7 @@ int HttpsUpstream::on_downstream_header_complete(Downstream *downstream) { #ifdef HAVE_MRUBY if (!downstream->get_non_final_response()) { + assert(dconn); const auto &group = dconn->get_downstream_addr_group(); if (group) { const auto &dmruby_ctx = group->mruby_ctx;