mirror of
https://github.com/moparisthebest/spdylay
synced 2024-11-05 00:55:07 -05:00
Added status_code argument to spdylay_on_invalid_ctrl_recv_callback
This commit is contained in:
parent
649e62bd33
commit
1158de22a3
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user