nghttp2.h: mention where user_data is set in the other callbacks as well
This commit is contained in:
parent
10f131c9d8
commit
f233a1a45e
|
@ -787,9 +787,9 @@ typedef union {
|
||||||
* not used and always 0. It must return the number of bytes sent if
|
* not used and always 0. It must return the number of bytes sent if
|
||||||
* it succeeds. If it cannot send any single byte without blocking,
|
* it succeeds. If it cannot send any single byte without blocking,
|
||||||
* it must return :enum:`NGHTTP2_ERR_WOULDBLOCK`. For other errors, it
|
* it must return :enum:`NGHTTP2_ERR_WOULDBLOCK`. For other errors, it
|
||||||
* must return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. The |user_data| pointer
|
* must return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. The |user_data|
|
||||||
* is the third argument passed in to the call to nghttp2_session_client_new
|
* pointer is the third argument passed in to the call to
|
||||||
* or nghttp2_session_server_new
|
* `nghttp2_session_client_new()` or `nghttp2_session_server_new()`.
|
||||||
*/
|
*/
|
||||||
typedef ssize_t (*nghttp2_send_callback)
|
typedef ssize_t (*nghttp2_send_callback)
|
||||||
(nghttp2_session *session,
|
(nghttp2_session *session,
|
||||||
|
@ -807,7 +807,9 @@ typedef ssize_t (*nghttp2_send_callback)
|
||||||
* it gets EOF before it reads any single byte, it must return
|
* it gets EOF before it reads any single byte, it must return
|
||||||
* :enum:`NGHTTP2_ERR_EOF`. For other errors, it must return
|
* :enum:`NGHTTP2_ERR_EOF`. For other errors, it must return
|
||||||
* :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. Returning 0 is treated as
|
* :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. Returning 0 is treated as
|
||||||
* :enum:`NGHTTP2_ERR_WOULDBLOCK`.
|
* :enum:`NGHTTP2_ERR_WOULDBLOCK`. The |user_data| pointer is the
|
||||||
|
* third argument passed in to the call to
|
||||||
|
* `nghttp2_session_client_new()` or `nghttp2_session_server_new()`.
|
||||||
*/
|
*/
|
||||||
typedef ssize_t (*nghttp2_recv_callback)
|
typedef ssize_t (*nghttp2_recv_callback)
|
||||||
(nghttp2_session *session,
|
(nghttp2_session *session,
|
||||||
|
@ -817,7 +819,9 @@ typedef ssize_t (*nghttp2_recv_callback)
|
||||||
* @functypedef
|
* @functypedef
|
||||||
*
|
*
|
||||||
* Callback function invoked by `nghttp2_session_recv()` when a
|
* Callback function invoked by `nghttp2_session_recv()` when a
|
||||||
* non-DATA frame is received.
|
* non-DATA 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()`.
|
||||||
*
|
*
|
||||||
* The implementation of this function must return 0 if it
|
* The implementation of this function must return 0 if it
|
||||||
* succeeds. If nonzero is returned, it is treated as fatal error and
|
* succeeds. If nonzero is returned, it is treated as fatal error and
|
||||||
|
@ -834,7 +838,9 @@ typedef int (*nghttp2_on_frame_recv_callback)
|
||||||
* invalid non-DATA frame is received. The |error_code| is one of the
|
* invalid non-DATA frame is received. The |error_code| is one of the
|
||||||
* :enum:`nghttp2_error_code` and indicates the error. When this
|
* :enum:`nghttp2_error_code` and indicates the error. When this
|
||||||
* callback function is invoked, the library automatically submits
|
* callback function is invoked, the library automatically submits
|
||||||
* either RST_STREAM or GOAWAY frame.
|
* 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()`.
|
||||||
*
|
*
|
||||||
* The implementation of this function must return 0 if it
|
* The implementation of this function must return 0 if it
|
||||||
* succeeds. If nonzero is returned, it is treated as fatal error and
|
* succeeds. If nonzero is returned, it is treated as fatal error and
|
||||||
|
@ -854,7 +860,9 @@ typedef int (*nghttp2_on_invalid_frame_recv_callback)
|
||||||
* contained. ``(flags & NGHTTP2_FLAG_END_STREAM) != 0`` does not
|
* contained. ``(flags & NGHTTP2_FLAG_END_STREAM) != 0`` does not
|
||||||
* necessarily mean this chunk of data is the last one in the
|
* necessarily mean this chunk of data is the last one in the
|
||||||
* stream. You should use :type:`nghttp2_on_data_recv_callback` to
|
* stream. You should use :type:`nghttp2_on_data_recv_callback` to
|
||||||
* know all data frames are received.
|
* know all data frames are received. The |user_data| pointer is the
|
||||||
|
* third argument passed in to the call to
|
||||||
|
* `nghttp2_session_client_new()` or `nghttp2_session_server_new()`.
|
||||||
*
|
*
|
||||||
* The implementation of this function must return 0 if it
|
* The implementation of this function must return 0 if it
|
||||||
* succeeds. If nonzero is returned, it is treated as fatal error and
|
* succeeds. If nonzero is returned, it is treated as fatal error and
|
||||||
|
@ -870,7 +878,9 @@ typedef int (*nghttp2_on_data_chunk_recv_callback)
|
||||||
*
|
*
|
||||||
* Callback function invoked when DATA frame is received. The actual
|
* Callback function invoked when DATA frame is received. The actual
|
||||||
* data it contains are received by
|
* data it contains are received by
|
||||||
* :type:`nghttp2_on_data_chunk_recv_callback`.
|
* :type:`nghttp2_on_data_chunk_recv_callback`. The |user_data|
|
||||||
|
* pointer is the third argument passed in to the call to
|
||||||
|
* `nghttp2_session_client_new()` or `nghttp2_session_server_new()`.
|
||||||
*
|
*
|
||||||
* The implementation of this function must return 0 if it
|
* The implementation of this function must return 0 if it
|
||||||
* succeeds. If nonzero is returned, it is treated as fatal error and
|
* succeeds. If nonzero is returned, it is treated as fatal error and
|
||||||
|
@ -888,7 +898,9 @@ typedef int (*nghttp2_on_data_recv_callback)
|
||||||
* sent. This may be useful, for example, to know the stream ID of
|
* sent. This may be useful, for example, to know the stream ID of
|
||||||
* HEADERS and PUSH_PROMISE frame (see also
|
* HEADERS and PUSH_PROMISE frame (see also
|
||||||
* `nghttp2_session_get_stream_user_data()`), which is not assigned
|
* `nghttp2_session_get_stream_user_data()`), which is not assigned
|
||||||
* when it was queued.
|
* when it was queued. The |user_data| pointer is the third argument
|
||||||
|
* passed in to the call to `nghttp2_session_client_new()` or
|
||||||
|
* `nghttp2_session_server_new()`.
|
||||||
*
|
*
|
||||||
* The implementation of this function must return 0 if it
|
* The implementation of this function must return 0 if it
|
||||||
* succeeds. If nonzero is returned, it is treated as fatal error and
|
* succeeds. If nonzero is returned, it is treated as fatal error and
|
||||||
|
@ -902,6 +914,9 @@ typedef int (*nghttp2_before_frame_send_callback)
|
||||||
* @functypedef
|
* @functypedef
|
||||||
*
|
*
|
||||||
* Callback function invoked after the non-DATA frame |frame| is sent.
|
* Callback function invoked after the non-DATA frame |frame| is sent.
|
||||||
|
* The |user_data| pointer is the third argument passed in to the call
|
||||||
|
* to `nghttp2_session_client_new()` or
|
||||||
|
* `nghttp2_session_server_new()`.
|
||||||
*
|
*
|
||||||
* The implementation of this function must return 0 if it
|
* The implementation of this function must return 0 if it
|
||||||
* succeeds. If nonzero is returned, it is treated as fatal error and
|
* succeeds. If nonzero is returned, it is treated as fatal error and
|
||||||
|
@ -917,7 +932,9 @@ typedef int (*nghttp2_on_frame_send_callback)
|
||||||
* Callback function invoked after the non-DATA frame |frame| is not
|
* Callback function invoked after the non-DATA frame |frame| is not
|
||||||
* sent because of the error. The error is indicated by the
|
* sent because of the error. The error is indicated by the
|
||||||
* |lib_error_code|, which is one of the values defined in
|
* |lib_error_code|, which is one of the values defined in
|
||||||
* :type:`nghttp2_error`.
|
* :type:`nghttp2_error`. The |user_data| pointer is the third
|
||||||
|
* argument passed in to the call to `nghttp2_session_client_new()` or
|
||||||
|
* `nghttp2_session_server_new()`.
|
||||||
*
|
*
|
||||||
* The implementation of this function must return 0 if it
|
* The implementation of this function must return 0 if it
|
||||||
* succeeds. If nonzero is returned, it is treated as fatal error and
|
* succeeds. If nonzero is returned, it is treated as fatal error and
|
||||||
|
@ -931,7 +948,9 @@ typedef int (*nghttp2_on_frame_not_send_callback)
|
||||||
/**
|
/**
|
||||||
* @functypedef
|
* @functypedef
|
||||||
*
|
*
|
||||||
* Callback function invoked after DATA frame is sent.
|
* Callback function invoked after DATA frame is sent. The |user_data|
|
||||||
|
* pointer is the third argument passed in to the call to
|
||||||
|
* `nghttp2_session_client_new()` or `nghttp2_session_server_new()`.
|
||||||
*
|
*
|
||||||
* The implementation of this function must return 0 if it
|
* The implementation of this function must return 0 if it
|
||||||
* succeeds. If nonzero is returned, it is treated as fatal error and
|
* succeeds. If nonzero is returned, it is treated as fatal error and
|
||||||
|
@ -946,10 +965,12 @@ typedef int (*nghttp2_on_data_send_callback)
|
||||||
* @functypedef
|
* @functypedef
|
||||||
*
|
*
|
||||||
* Callback function invoked when the stream |stream_id| is
|
* Callback function invoked when the stream |stream_id| is
|
||||||
* closed. The reason of closure is indicated by the
|
* closed. The reason of closure is indicated by the |error_code|. The
|
||||||
* |error_code|. The stream_user_data, which was specified in
|
* stream_user_data, which was specified in `nghttp2_submit_request()`
|
||||||
* `nghttp2_submit_request()` or `nghttp2_submit_headers()`, is
|
* or `nghttp2_submit_headers()`, is still available in this
|
||||||
* still available in this function.
|
* function. The |user_data| pointer is the third argument passed in
|
||||||
|
* to the call to `nghttp2_session_client_new()` or
|
||||||
|
* `nghttp2_session_server_new()`.
|
||||||
*
|
*
|
||||||
* The implementation of this function must return 0 if it
|
* The implementation of this function must return 0 if it
|
||||||
* succeeds. If nonzero is returned, it is treated as fatal error and
|
* succeeds. If nonzero is returned, it is treated as fatal error and
|
||||||
|
@ -966,7 +987,9 @@ typedef int (*nghttp2_on_stream_close_callback)
|
||||||
* Callback function invoked when the request from the remote peer is
|
* Callback function invoked when the request from the remote peer is
|
||||||
* received. In other words, the frame with END_STREAM flag set is
|
* received. In other words, the frame with END_STREAM flag set is
|
||||||
* received. In HTTP, this means HTTP request, including request
|
* received. In HTTP, this means HTTP request, including request
|
||||||
* body, is fully received.
|
* body, is fully received. The |user_data| pointer is the third
|
||||||
|
* argument passed in to the call to `nghttp2_session_client_new()` or
|
||||||
|
* `nghttp2_session_server_new()`.
|
||||||
*
|
*
|
||||||
* The implementation of this function must return 0 if it
|
* The implementation of this function must return 0 if it
|
||||||
* succeeds. If nonzero is returned, it is treated as fatal error and
|
* succeeds. If nonzero is returned, it is treated as fatal error and
|
||||||
|
@ -987,8 +1010,10 @@ typedef int (*nghttp2_on_request_recv_callback)
|
||||||
* words, the |head| is the first 8 bytes of the received frame. The
|
* words, the |head| is the first 8 bytes of the received frame. The
|
||||||
* |payload| is the pointer to the data portion of the received frame.
|
* |payload| is the pointer to the data portion of the received frame.
|
||||||
* The |payloadlen| is the length of the |payload|. This is the data
|
* The |payloadlen| is the length of the |payload|. This is the data
|
||||||
* after the length field. The |lib_error_code| is one of the error code
|
* after the length field. The |lib_error_code| is one of the error
|
||||||
* defined in :enum:`nghttp2_error` and indicates the error.
|
* code defined in :enum:`nghttp2_error` and indicates the error. The
|
||||||
|
* |user_data| pointer is the third argument passed in to the call to
|
||||||
|
* `nghttp2_session_client_new()` or `nghttp2_session_server_new()`.
|
||||||
*
|
*
|
||||||
* The implementation of this function must return 0 if it
|
* The implementation of this function must return 0 if it
|
||||||
* succeeds. If nonzero is returned, it is treated as fatal error and
|
* succeeds. If nonzero is returned, it is treated as fatal error and
|
||||||
|
@ -1010,7 +1035,10 @@ typedef int (*nghttp2_on_frame_recv_parse_error_callback)
|
||||||
* spec, the |headlen| is always 8. In other words, the |head| is the
|
* spec, the |headlen| is always 8. In other words, the |head| is the
|
||||||
* first 8 bytes of the received frame. The |payload| is the pointer
|
* first 8 bytes of the received frame. The |payload| is the pointer
|
||||||
* to the data portion of the received frame. The |payloadlen| is the
|
* to the data portion of the received frame. The |payloadlen| is the
|
||||||
* length of the |payload|. This is the data after the length field.
|
* length of the |payload|. This is the data after the length
|
||||||
|
* field. The |user_data| pointer is the third argument passed in to
|
||||||
|
* the call to `nghttp2_session_client_new()` or
|
||||||
|
* `nghttp2_session_server_new()`.
|
||||||
*
|
*
|
||||||
* The implementation of this function must return 0 if it
|
* The implementation of this function must return 0 if it
|
||||||
* succeeds. If nonzero is returned, it is treated as fatal error and
|
* succeeds. If nonzero is returned, it is treated as fatal error and
|
||||||
|
|
Loading…
Reference in New Issue