From 799a76de74d53b3947baa39a8e66c65f4ce88820 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 15 Mar 2017 23:13:54 +0900 Subject: [PATCH] nghttpx: Lesser usage of DIE --- src/shrpx_http2_session.cc | 3 ++- src/shrpx_http2_upstream.cc | 2 +- src/shrpx_spdy_upstream.cc | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/shrpx_http2_session.cc b/src/shrpx_http2_session.cc index 997cbb4a..d3f302e1 100644 --- a/src/shrpx_http2_session.cc +++ b/src/shrpx_http2_session.cc @@ -602,7 +602,8 @@ int Http2Session::initiate_connection() { } // Unreachable - DIE(); + assert(0); + return 0; } diff --git a/src/shrpx_http2_upstream.cc b/src/shrpx_http2_upstream.cc index ef591636..235143e8 100644 --- a/src/shrpx_http2_upstream.cc +++ b/src/shrpx_http2_upstream.cc @@ -1360,7 +1360,7 @@ int Http2Upstream::rst_stream(Downstream *downstream, uint32_t error_code) { if (rv < NGHTTP2_ERR_FATAL) { ULOG(FATAL, this) << "nghttp2_submit_rst_stream() failed: " << nghttp2_strerror(rv); - DIE(); + return -1; } return 0; } diff --git a/src/shrpx_spdy_upstream.cc b/src/shrpx_spdy_upstream.cc index 562df515..af7ab81f 100644 --- a/src/shrpx_spdy_upstream.cc +++ b/src/shrpx_spdy_upstream.cc @@ -854,7 +854,7 @@ int SpdyUpstream::rst_stream(Downstream *downstream, int status_code) { if (rv < SPDYLAY_ERR_FATAL) { ULOG(FATAL, this) << "spdylay_submit_rst_stream() failed: " << spdylay_strerror(rv); - DIE(); + return -1; } return 0; }