From b9f602b9a2725abff21e5852b74fc3d4edcb5d29 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Thu, 23 Apr 2015 21:13:15 +0900 Subject: [PATCH] Update doc --- lib/includes/nghttp2/nghttp2.h | 59 ++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 28 deletions(-) diff --git a/lib/includes/nghttp2/nghttp2.h b/lib/includes/nghttp2/nghttp2.h index 6f601244..0c6122c2 100644 --- a/lib/includes/nghttp2/nghttp2.h +++ b/lib/includes/nghttp2/nghttp2.h @@ -241,8 +241,9 @@ typedef enum { */ NGHTTP2_ERR_UNSUPPORTED_VERSION = -503, /** - * Used as a return value from :type:`nghttp2_send_callback` and - * :type:`nghttp2_recv_callback` to indicate that the operation + * Used as a return value from :type:`nghttp2_send_callback`, + * :type:`nghttp2_recv_callback` and + * :type:`nghttp2_send_data_callback` to indicate that the operation * would block. */ NGHTTP2_ERR_WOULDBLOCK = -504, @@ -1275,10 +1276,10 @@ typedef ssize_t (*nghttp2_recv_callback)(nghttp2_session *session, uint8_t *buf, /** * @functypedef * - * Callback function invoked by `nghttp2_session_recv()` when a frame - * is received. The |user_data| pointer is the third argument passed - * in to the call to `nghttp2_session_client_new()` or - * `nghttp2_session_server_new()`. + * Callback function invoked by `nghttp2_session_recv()` and + * `nghttp2_session_mem_recv()` when a frame is received. The + * |user_data| pointer is the third argument passed in to the call to + * `nghttp2_session_client_new()` or `nghttp2_session_server_new()`. * * If frame is HEADERS or PUSH_PROMISE, the ``nva`` and ``nvlen`` * 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 * - * Callback function invoked by `nghttp2_session_recv()` when an - * invalid non-DATA frame is received. The |error_code| indicates the - * error. It is usually one of the :enum:`nghttp2_error_code` but - * that is not guaranteed. When this callback function is invoked, - * the library automatically submits either RST_STREAM or GOAWAY - * frame. The |user_data| pointer is the third argument passed in to - * the call to `nghttp2_session_client_new()` or - * `nghttp2_session_server_new()`. + * Callback function invoked by `nghttp2_session_recv()` and + * `nghttp2_session_mem_recv()` when an invalid non-DATA frame is + * received. The |error_code| indicates the error. It is usually one + * of the :enum:`nghttp2_error_code` but that is not guaranteed. When + * this callback function is invoked, the library automatically + * submits either RST_STREAM or GOAWAY frame. The |user_data| pointer + * is the third argument passed in to the call to + * `nghttp2_session_client_new()` or `nghttp2_session_server_new()`. * * If frame is HEADERS or PUSH_PROMISE, the ``nva`` and ``nvlen`` * 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. * 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`. * * 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. * * 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 * 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. * 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`. * * 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. * 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`. * * 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. * 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`. * * `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. * If nonzero is returned, it is treated as fatal error and - * `nghttp2_session_recv()` and `nghttp2_session_send()` functions - * immediately return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. + * `nghttp2_session_recv()`, `nghttp2_session_mem_recv()`, + * `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 * `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`` * containing final response headers (non-1xx status code). The * 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 * :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 * ``frame->hd.length`` means no padding is added. Returning * :enum:`NGHTTP2_ERR_CALLBACK_FAILURE` will make - * `nghttp2_session_send()` function 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 * `nghttp2_session_callbacks_set_select_padding_callback()`. @@ -1726,8 +1728,8 @@ NGHTTP2_EXTERN void nghttp2_session_callbacks_set_recv_callback( /** * @function * - * Sets callback function invoked by `nghttp2_session_recv()` when a - * frame is received. + * Sets callback function invoked by `nghttp2_session_recv()` and + * `nghttp2_session_mem_recv()` when a frame is received. */ NGHTTP2_EXTERN void nghttp2_session_callbacks_set_on_frame_recv_callback( nghttp2_session_callbacks *cbs, @@ -1736,8 +1738,9 @@ NGHTTP2_EXTERN void nghttp2_session_callbacks_set_on_frame_recv_callback( /** * @function * - * Sets callback function invoked by `nghttp2_session_recv()` when an - * invalid non-DATA frame is received. + * Sets callback function invoked by `nghttp2_session_recv()` and + * `nghttp2_session_mem_recv()` when an invalid non-DATA frame is + * received. */ NGHTTP2_EXTERN void nghttp2_session_callbacks_set_on_invalid_frame_recv_callback(