Added spdylay_submit_cancel() to send RST_STREAM

This commit is contained in:
Tatsuhiro Tsujikawa 2012-02-06 21:20:35 +09:00
parent 00bed87537
commit a14b9a1ba6
2 changed files with 14 additions and 0 deletions

View File

@ -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.

View File

@ -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);