From 276792a81209e975dcbfa62d86b66425613d8164 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Tue, 23 Feb 2021 14:32:43 +0900 Subject: [PATCH] Remove unnecessary function on_stream_close is called after on_frame_not_send_callback with success=false without this function. --- src/h2load_http2_session.cc | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/src/h2load_http2_session.cc b/src/h2load_http2_session.cc index 28ad456c..06c474c0 100644 --- a/src/h2load_http2_session.cc +++ b/src/h2load_http2_session.cc @@ -105,23 +105,6 @@ int on_stream_close_callback(nghttp2_session *session, int32_t stream_id, } } // namespace -namespace { -int on_frame_not_send_callback(nghttp2_session *session, - const nghttp2_frame *frame, int lib_error_code, - void *user_data) { - if (frame->hd.type != NGHTTP2_HEADERS || - frame->headers.cat != NGHTTP2_HCAT_REQUEST) { - return 0; - } - - auto client = static_cast(user_data); - // request was not sent. Mark it as error. - client->on_stream_close(frame->hd.stream_id, false); - - return 0; -} -} // namespace - namespace { int before_frame_send_callback(nghttp2_session *session, const nghttp2_frame *frame, void *user_data) { @@ -211,9 +194,6 @@ void Http2Session::on_connect() { nghttp2_session_callbacks_set_on_header_callback(callbacks, on_header_callback); - nghttp2_session_callbacks_set_on_frame_not_send_callback( - callbacks, on_frame_not_send_callback); - nghttp2_session_callbacks_set_before_frame_send_callback( callbacks, before_frame_send_callback);