| 2629 | } |
| 2630 | |
| 2631 | void |
| 2632 | Http2ConnectionState::send_rst_stream_frame(Http2StreamId id, Http2ErrorCode ec) |
| 2633 | { |
| 2634 | Http2StreamDebug(session, id, "Send RST_STREAM frame: Error Code: %u", static_cast<uint32_t>(ec)); |
| 2635 | |
| 2636 | if (ec != Http2ErrorCode::HTTP2_ERROR_NO_ERROR) { |
| 2637 | Metrics::Counter::increment(http2_rsb.stream_errors_count); |
| 2638 | ++stream_error_count; |
| 2639 | } |
| 2640 | |
| 2641 | // change state to closed |
| 2642 | Http2Stream *stream = find_stream(id); |
| 2643 | if (stream != nullptr) { |
| 2644 | stream->set_tx_error_code({ProxyErrorClass::TXN, static_cast<uint32_t>(ec)}); |
| 2645 | if (!stream->change_state(HTTP2_FRAME_TYPE_RST_STREAM, 0)) { |
| 2646 | this->send_goaway_frame(this->latest_streamid_in, Http2ErrorCode::HTTP2_ERROR_PROTOCOL_ERROR); |
| 2647 | this->session->set_half_close_local_flag(true); |
| 2648 | if (fini_event == nullptr) { |
| 2649 | fini_event = this_ethread()->schedule_imm_local(static_cast<Continuation *>(this), HTTP2_SESSION_EVENT_FINI); |
| 2650 | } |
| 2651 | |
| 2652 | return; |
| 2653 | } |
| 2654 | } |
| 2655 | |
| 2656 | Http2RstStreamFrame rst_stream(id, static_cast<uint32_t>(ec)); |
| 2657 | this->session->xmit(rst_stream); |
| 2658 | } |
| 2659 | |
| 2660 | void |
| 2661 | Http2ConnectionState::send_settings_frame(const Http2ConnectionSettings &new_settings) |
no test coverage detected