From 81f81e6b70937280b86b2451d8fe313e7e05ada3 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 13 Apr 2016 19:22:32 +0900 Subject: [PATCH] nghttpx: Error handling without assert --- src/shrpx_http2_session.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/shrpx_http2_session.cc b/src/shrpx_http2_session.cc index daf6798a..7499fe7a 100644 --- a/src/shrpx_http2_session.cc +++ b/src/shrpx_http2_session.cc @@ -2052,7 +2052,9 @@ DownstreamAddrGroup *Http2Session::get_downstream_addr_group() const { } void Http2Session::add_to_avail_freelist() { - assert(freelist_zone_ == FREELIST_ZONE_NONE); + if (freelist_zone_ != FREELIST_ZONE_NONE) { + return; + } if (LOG_ENABLED(INFO)) { SSLOG(INFO, this) << "Append to http2_avail_freelist, group=" << group_ @@ -2066,7 +2068,9 @@ void Http2Session::add_to_avail_freelist() { } void Http2Session::add_to_extra_freelist() { - assert(freelist_zone_ == FREELIST_ZONE_NONE); + if (freelist_zone_ != FREELIST_ZONE_NONE) { + return; + } if (LOG_ENABLED(INFO)) { SSLOG(INFO, this) << "Append to http2_extra_freelist, addr=" << addr_