diff --git a/lib/includes/spdylay/spdylay.h b/lib/includes/spdylay/spdylay.h index b5b03c7f..4b456a17 100644 --- a/lib/includes/spdylay/spdylay.h +++ b/lib/includes/spdylay/spdylay.h @@ -428,6 +428,14 @@ int spdylay_submit_response(spdylay_session *session, int32_t stream_id, const char **nv, spdylay_data_provider *data_prd); +/* + * Submits RST_STREAM frame to cancel/reset stream |stream_id| with + * status code |status_code|. This function returns 0 if it succeeds, + * or negative error code. + */ +int spdylay_submit_cancel(spdylay_session *session, int32_t stream_id, + uint32_t status_code); + /* * Submits PING frame. This function returns 0 if it succeeds, or * negative error code. diff --git a/lib/spdylay_session.c b/lib/spdylay_session.c index 57501fd1..a65f763d 100644 --- a/lib/spdylay_session.c +++ b/lib/spdylay_session.c @@ -1486,6 +1486,12 @@ int spdylay_submit_ping(spdylay_session *session) spdylay_session_get_next_unique_id(session)); } +int spdylay_submit_cancel(spdylay_session *session, int32_t stream_id, + uint32_t status_code) +{ + return spdylay_session_add_rst_stream(session, stream_id, status_code); +} + int spdylay_submit_goaway(spdylay_session *session) { return spdylay_session_add_goaway(session, session->last_recv_stream_id);