nghttpx: Deal with the case when h2 backend is retired before it is initialized

This commit is contained in:
Tatsuhiro Tsujikawa 2020-11-15 11:18:32 +09:00
parent 2e44f23b05
commit da7959c2e8
1 changed files with 4 additions and 0 deletions

View File

@ -2379,6 +2379,10 @@ void Http2Session::check_retire() {
ev_prepare_stop(conn_.loop, &prep_); ev_prepare_stop(conn_.loop, &prep_);
if (!session_) {
return;
}
auto last_stream_id = nghttp2_session_get_last_proc_stream_id(session_); auto last_stream_id = nghttp2_session_get_last_proc_stream_id(session_);
nghttp2_submit_goaway(session_, NGHTTP2_FLAG_NONE, last_stream_id, nghttp2_submit_goaway(session_, NGHTTP2_FLAG_NONE, last_stream_id,
NGHTTP2_NO_ERROR, nullptr, 0); NGHTTP2_NO_ERROR, nullptr, 0);