| 874 | } |
| 875 | |
| 876 | Http2Error |
| 877 | Http2ConnectionState::rcv_goaway_frame(const Http2Frame &frame) |
| 878 | { |
| 879 | Http2Goaway goaway; |
| 880 | char buf[HTTP2_GOAWAY_LEN]; |
| 881 | char *end; |
| 882 | const Http2StreamId stream_id = frame.header().streamid; |
| 883 | |
| 884 | Http2StreamDebug(this->session, stream_id, "Received GOAWAY frame"); |
| 885 | |
| 886 | // An endpoint MUST treat a GOAWAY frame with a stream identifier other |
| 887 | // than 0x0 as a connection error of type PROTOCOL_ERROR. |
| 888 | if (stream_id != 0x0) { |
| 889 | return Http2Error(Http2ErrorClass::HTTP2_ERROR_CLASS_CONNECTION, Http2ErrorCode::HTTP2_ERROR_PROTOCOL_ERROR, |
| 890 | "goaway id non-zero"); |
| 891 | } |
| 892 | |
| 893 | end = frame.reader()->memcpy(buf, sizeof(buf), 0); |
| 894 | |
| 895 | if (!http2_parse_goaway(make_iovec(buf, end - buf), goaway)) { |
| 896 | return Http2Error(Http2ErrorClass::HTTP2_ERROR_CLASS_CONNECTION, Http2ErrorCode::HTTP2_ERROR_PROTOCOL_ERROR, |
| 897 | "goaway failed parse"); |
| 898 | } |
| 899 | |
| 900 | Http2StreamDebug(this->session, stream_id, "GOAWAY: last stream id=%d, error code=%d", goaway.last_streamid, |
| 901 | static_cast<int>(goaway.error_code)); |
| 902 | |
| 903 | this->rx_error_code = {ProxyErrorClass::SSN, static_cast<uint32_t>(goaway.error_code)}; |
| 904 | this->session->get_proxy_session()->do_io_close(); |
| 905 | |
| 906 | return Http2Error(Http2ErrorClass::HTTP2_ERROR_CLASS_NONE); |
| 907 | } |
| 908 | |
| 909 | Http2Error |
| 910 | Http2ConnectionState::rcv_window_update_frame(const Http2Frame &frame) |
nothing calls this directly
no test coverage detected