Update doc

This commit is contained in:
Tatsuhiro Tsujikawa 2015-04-23 21:13:15 +09:00
parent 1a99bcc860
commit b9f602b9a2
1 changed files with 31 additions and 28 deletions

View File

@ -241,8 +241,9 @@ typedef enum {
*/ */
NGHTTP2_ERR_UNSUPPORTED_VERSION = -503, NGHTTP2_ERR_UNSUPPORTED_VERSION = -503,
/** /**
* Used as a return value from :type:`nghttp2_send_callback` and * Used as a return value from :type:`nghttp2_send_callback`,
* :type:`nghttp2_recv_callback` to indicate that the operation * :type:`nghttp2_recv_callback` and
* :type:`nghttp2_send_data_callback` to indicate that the operation
* would block. * would block.
*/ */
NGHTTP2_ERR_WOULDBLOCK = -504, NGHTTP2_ERR_WOULDBLOCK = -504,
@ -1275,10 +1276,10 @@ typedef ssize_t (*nghttp2_recv_callback)(nghttp2_session *session, uint8_t *buf,
/** /**
* @functypedef * @functypedef
* *
* Callback function invoked by `nghttp2_session_recv()` when a frame * Callback function invoked by `nghttp2_session_recv()` and
* is received. The |user_data| pointer is the third argument passed * `nghttp2_session_mem_recv()` when a frame is received. The
* in to the call to `nghttp2_session_client_new()` or * |user_data| pointer is the third argument passed in to the call to
* `nghttp2_session_server_new()`. * `nghttp2_session_client_new()` or `nghttp2_session_server_new()`.
* *
* If frame is HEADERS or PUSH_PROMISE, the ``nva`` and ``nvlen`` * If frame is HEADERS or PUSH_PROMISE, the ``nva`` and ``nvlen``
* member of their data structure are always ``NULL`` and 0 * member of their data structure are always ``NULL`` and 0
@ -1313,14 +1314,14 @@ typedef int (*nghttp2_on_frame_recv_callback)(nghttp2_session *session,
/** /**
* @functypedef * @functypedef
* *
* Callback function invoked by `nghttp2_session_recv()` when an * Callback function invoked by `nghttp2_session_recv()` and
* invalid non-DATA frame is received. The |error_code| indicates the * `nghttp2_session_mem_recv()` when an invalid non-DATA frame is
* error. It is usually one of the :enum:`nghttp2_error_code` but * received. The |error_code| indicates the error. It is usually one
* that is not guaranteed. When this callback function is invoked, * of the :enum:`nghttp2_error_code` but that is not guaranteed. When
* the library automatically submits either RST_STREAM or GOAWAY * this callback function is invoked, the library automatically
* frame. The |user_data| pointer is the third argument passed in to * submits either RST_STREAM or GOAWAY frame. The |user_data| pointer
* the call to `nghttp2_session_client_new()` or * is the third argument passed in to the call to
* `nghttp2_session_server_new()`. * `nghttp2_session_client_new()` or `nghttp2_session_server_new()`.
* *
* If frame is HEADERS or PUSH_PROMISE, the ``nva`` and ``nvlen`` * If frame is HEADERS or PUSH_PROMISE, the ``nva`` and ``nvlen``
* member of their data structure are always ``NULL`` and 0 * member of their data structure are always ``NULL`` and 0
@ -1328,7 +1329,7 @@ typedef int (*nghttp2_on_frame_recv_callback)(nghttp2_session *session,
* *
* The implementation of this function must return 0 if it succeeds. * The implementation of this function must return 0 if it succeeds.
* If nonzero is returned, it is treated as fatal error and * If nonzero is returned, it is treated as fatal error and
* `nghttp2_session_recv()` and `nghttp2_session_send()` functions * `nghttp2_session_recv()` and `nghttp2_session_mem_recv()` functions
* immediately return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. * immediately return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`.
* *
* To set this callback to :type:`nghttp2_session_callbacks`, use * To set this callback to :type:`nghttp2_session_callbacks`, use
@ -1361,7 +1362,7 @@ typedef int (*nghttp2_on_invalid_frame_recv_callback)(
* region included in the input bytes. * region included in the input bytes.
* *
* The implementation of this function must return 0 if it succeeds. * The implementation of this function must return 0 if it succeeds.
* If nonzero is returned, it is treated as fatal error and * If nonzero is returned, it is treated as fatal error, and
* `nghttp2_session_recv()` and `nghttp2_session_mem_recv()` functions * `nghttp2_session_recv()` and `nghttp2_session_mem_recv()` functions
* immediately return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. * immediately return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`.
* *
@ -1384,7 +1385,7 @@ typedef int (*nghttp2_on_data_chunk_recv_callback)(nghttp2_session *session,
* *
* The implementation of this function must return 0 if it succeeds. * The implementation of this function must return 0 if it succeeds.
* If nonzero is returned, it is treated as fatal error and * If nonzero is returned, it is treated as fatal error and
* `nghttp2_session_recv()` and `nghttp2_session_send()` functions * `nghttp2_session_send()` and `nghttp2_session_mem_send()` functions
* immediately return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. * immediately return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`.
* *
* To set this callback to :type:`nghttp2_session_callbacks`, use * To set this callback to :type:`nghttp2_session_callbacks`, use
@ -1403,7 +1404,7 @@ typedef int (*nghttp2_before_frame_send_callback)(nghttp2_session *session,
* *
* The implementation of this function must return 0 if it succeeds. * The implementation of this function must return 0 if it succeeds.
* If nonzero is returned, it is treated as fatal error and * If nonzero is returned, it is treated as fatal error and
* `nghttp2_session_recv()` and `nghttp2_session_send()` functions * `nghttp2_session_send()` and `nghttp2_session_mem_send()` functions
* immediately return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. * immediately return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`.
* *
* To set this callback to :type:`nghttp2_session_callbacks`, use * To set this callback to :type:`nghttp2_session_callbacks`, use
@ -1425,7 +1426,7 @@ typedef int (*nghttp2_on_frame_send_callback)(nghttp2_session *session,
* *
* The implementation of this function must return 0 if it succeeds. * The implementation of this function must return 0 if it succeeds.
* If nonzero is returned, it is treated as fatal error and * If nonzero is returned, it is treated as fatal error and
* `nghttp2_session_recv()` and `nghttp2_session_send()` functions * `nghttp2_session_send()` and `nghttp2_session_mem_send()` functions
* immediately return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. * immediately return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`.
* *
* `nghttp2_session_get_stream_user_data()` can be used to get * `nghttp2_session_get_stream_user_data()` can be used to get
@ -1455,8 +1456,9 @@ typedef int (*nghttp2_on_frame_not_send_callback)(nghttp2_session *session,
* *
* The implementation of this function must return 0 if it succeeds. * The implementation of this function must return 0 if it succeeds.
* If nonzero is returned, it is treated as fatal error and * If nonzero is returned, it is treated as fatal error and
* `nghttp2_session_recv()` and `nghttp2_session_send()` functions * `nghttp2_session_recv()`, `nghttp2_session_mem_recv()`,
* immediately return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. * `nghttp2_session_send()`, and `nghttp2_session_mem_send()`
* functions immediately return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`.
* *
* To set this callback to :type:`nghttp2_session_callbacks`, use * To set this callback to :type:`nghttp2_session_callbacks`, use
* `nghttp2_session_callbacks_set_on_stream_close_callback()`. * `nghttp2_session_callbacks_set_on_stream_close_callback()`.
@ -1498,7 +1500,7 @@ typedef int (*nghttp2_on_stream_close_callback)(nghttp2_session *session,
* frame with ``frame->headers.cat == NGHTTP2_HCAT_HEADERS`` * frame with ``frame->headers.cat == NGHTTP2_HCAT_HEADERS``
* containing final response headers (non-1xx status code). The * containing final response headers (non-1xx status code). The
* trailer headers also has ``frame->headers.cat == * trailer headers also has ``frame->headers.cat ==
* NGHTTP2_HCAT_HEADERS`` which does not containg any status code. * NGHTTP2_HCAT_HEADERS`` which does not contain any status code.
* *
* The implementation of this function must return 0 if it succeeds or * The implementation of this function must return 0 if it succeeds or
* :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. If nonzero value other than * :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. If nonzero value other than
@ -1596,8 +1598,8 @@ typedef int (*nghttp2_on_header_callback)(nghttp2_session *session,
* :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. Returning * :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. Returning
* ``frame->hd.length`` means no padding is added. Returning * ``frame->hd.length`` means no padding is added. Returning
* :enum:`NGHTTP2_ERR_CALLBACK_FAILURE` will make * :enum:`NGHTTP2_ERR_CALLBACK_FAILURE` will make
* `nghttp2_session_send()` function immediately return * `nghttp2_session_send()` and `nghttp2_session_mem_send()` functions
* :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. * immediately return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`.
* *
* To set this callback to :type:`nghttp2_session_callbacks`, use * To set this callback to :type:`nghttp2_session_callbacks`, use
* `nghttp2_session_callbacks_set_select_padding_callback()`. * `nghttp2_session_callbacks_set_select_padding_callback()`.
@ -1726,8 +1728,8 @@ NGHTTP2_EXTERN void nghttp2_session_callbacks_set_recv_callback(
/** /**
* @function * @function
* *
* Sets callback function invoked by `nghttp2_session_recv()` when a * Sets callback function invoked by `nghttp2_session_recv()` and
* frame is received. * `nghttp2_session_mem_recv()` when a frame is received.
*/ */
NGHTTP2_EXTERN void nghttp2_session_callbacks_set_on_frame_recv_callback( NGHTTP2_EXTERN void nghttp2_session_callbacks_set_on_frame_recv_callback(
nghttp2_session_callbacks *cbs, nghttp2_session_callbacks *cbs,
@ -1736,8 +1738,9 @@ NGHTTP2_EXTERN void nghttp2_session_callbacks_set_on_frame_recv_callback(
/** /**
* @function * @function
* *
* Sets callback function invoked by `nghttp2_session_recv()` when an * Sets callback function invoked by `nghttp2_session_recv()` and
* invalid non-DATA frame is received. * `nghttp2_session_mem_recv()` when an invalid non-DATA frame is
* received.
*/ */
NGHTTP2_EXTERN void NGHTTP2_EXTERN void
nghttp2_session_callbacks_set_on_invalid_frame_recv_callback( nghttp2_session_callbacks_set_on_invalid_frame_recv_callback(