From 890a10b216681487f91eb39dbcabfaaf3b861bd9 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 22 May 2015 00:53:02 +0900 Subject: [PATCH] nghttpx: Fix bug that PUSH_PROMISE is sent after associated response HEADERS --- src/shrpx_http2_upstream.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/shrpx_http2_upstream.cc b/src/shrpx_http2_upstream.cc index e3aa67f6..856ae04f 100644 --- a/src/shrpx_http2_upstream.cc +++ b/src/shrpx_http2_upstream.cc @@ -1317,13 +1317,6 @@ int Http2Upstream::on_downstream_header_complete(Downstream *downstream) { data_prdptr = nullptr; } - rv = nghttp2_submit_response(session_, downstream->get_stream_id(), - nva.data(), nva.size(), data_prdptr); - if (rv != 0) { - ULOG(FATAL, this) << "nghttp2_submit_response() failed"; - return -1; - } - // We need some conditions that must be fulfilled to initiate server // push. // @@ -1353,6 +1346,13 @@ int Http2Upstream::on_downstream_header_complete(Downstream *downstream) { } } + rv = nghttp2_submit_response(session_, downstream->get_stream_id(), + nva.data(), nva.size(), data_prdptr); + if (rv != 0) { + ULOG(FATAL, this) << "nghttp2_submit_response() failed"; + return -1; + } + return 0; }