Exposed spdylay_session_fail_session() to the public API.

This commit is contained in:
Tatsuhiro Tsujikawa 2012-04-06 02:16:01 +09:00
parent ab0bd62b14
commit 94650de16e
2 changed files with 21 additions and 7 deletions

View File

@ -1430,6 +1430,25 @@ size_t spdylay_session_get_outbound_queue_size(spdylay_session *session);
*/
uint8_t spdylay_session_get_pri_lowest(spdylay_session *session);
/*
* @function
*
* Submits GOAWAY frame. The status code |status_code| is ignored if
* the protocol version is :macro:`SPDYLAY_PROTO_SPDY2`.
*
* This function should be called when the connection should be
* terminated after sending GOAWAY. If the remaining streams should be
* processed after GOAWAY, use `spdylay_submit_goaway()` instead.
*
* This function returns 0 if it succeeds, or one of the following
* negative error codes:
*
* :enum:`SPDYLAY_ERR_NOMEM`
* Out of memory.
*/
int spdylay_session_fail_session(spdylay_session *session,
uint32_t status_code);
/**
* @function
*

View File

@ -63,12 +63,7 @@ static int spdylay_is_fatal(int error)
return error < SPDYLAY_ERR_FATAL;
}
/*
* This function should be called when the session wants to drop
* connection after sending GOAWAY. These cases are called as the
* session error. For example, when it receives bad zlib data.
*/
static int spdylay_session_fail_session(spdylay_session *session,
int spdylay_session_fail_session(spdylay_session *session,
uint32_t status_code)
{
session->goaway_flags |= SPDYLAY_GOAWAY_FAIL_ON_SEND;