diff --git a/lib/includes/spdylay/spdylay.h b/lib/includes/spdylay/spdylay.h index 750edbe..843eceb 100644 --- a/lib/includes/spdylay/spdylay.h +++ b/lib/includes/spdylay/spdylay.h @@ -856,12 +856,14 @@ typedef void (*spdylay_on_ctrl_recv_callback) * @functypedef * * Callback function invoked by `spdylay_session_recv()` when an - * invalid control frame is received. When this callback function is - * invoked, either RST_STREAM or GOAWAY will be sent. + * invalid control frame is received. The |status_code| is one of the + * :enum:`spdylay_status_code` and indicates the error. When this + * callback function is invoked, either RST_STREAM or GOAWAY will be + * sent. */ typedef void (*spdylay_on_invalid_ctrl_recv_callback) (spdylay_session *session, spdylay_frame_type type, spdylay_frame *frame, - void *user_data); + uint32_t status_code, void *user_data); /** * @functypedef diff --git a/lib/spdylay_session.c b/lib/spdylay_session.c index 7811c78..7b08e7b 100644 --- a/lib/spdylay_session.c +++ b/lib/spdylay_session.c @@ -1630,7 +1630,7 @@ static int spdylay_session_handle_invalid_stream } if(session->callbacks.on_invalid_ctrl_recv_callback) { session->callbacks.on_invalid_ctrl_recv_callback - (session, type, frame, session->user_data); + (session, type, frame, status_code, session->user_data); } return 0; } @@ -1659,6 +1659,7 @@ int spdylay_session_on_syn_stream_received(spdylay_session *session, session->callbacks.on_invalid_ctrl_recv_callback(session, SPDYLAY_SYN_STREAM, frame, + SPDYLAY_PROTOCOL_ERROR, session->user_data); } return spdylay_session_fail_session(session, SPDYLAY_GOAWAY_PROTOCOL_ERROR); diff --git a/tests/spdylay_session_test.c b/tests/spdylay_session_test.c index a8c62d2..24d2fc8 100644 --- a/tests/spdylay_session_test.c +++ b/tests/spdylay_session_test.c @@ -128,6 +128,7 @@ static void on_ctrl_recv_callback(spdylay_session *session, static void on_invalid_ctrl_recv_callback(spdylay_session *session, spdylay_frame_type type, spdylay_frame *frame, + uint32_t status_code, void *user_data) { my_user_data *ud = (my_user_data*)user_data;