Update doc
This commit is contained in:
parent
6566ea7d6b
commit
afc6f556d1
|
@ -748,7 +748,7 @@ typedef enum {
|
||||||
/**
|
/**
|
||||||
* Indicates that END_STREAM flag must not be set even if
|
* Indicates that END_STREAM flag must not be set even if
|
||||||
* NGHTTP2_DATA_FLAG_EOF is set. Usually this flag is used to send
|
* NGHTTP2_DATA_FLAG_EOF is set. Usually this flag is used to send
|
||||||
* trailer header fields with `nghttp2_submit_request()` or
|
* trailer fields with `nghttp2_submit_request()` or
|
||||||
* `nghttp2_submit_response()`.
|
* `nghttp2_submit_response()`.
|
||||||
*/
|
*/
|
||||||
NGHTTP2_DATA_FLAG_NO_END_STREAM = 0x02,
|
NGHTTP2_DATA_FLAG_NO_END_STREAM = 0x02,
|
||||||
|
@ -784,13 +784,13 @@ typedef enum {
|
||||||
* :enum:`NGHTTP2_FLAG_END_STREAM` set, and
|
* :enum:`NGHTTP2_FLAG_END_STREAM` set, and
|
||||||
* :enum:`NGHTTP2_DATA_FLAG_EOF` flag is set to |*data_flags|, DATA
|
* :enum:`NGHTTP2_DATA_FLAG_EOF` flag is set to |*data_flags|, DATA
|
||||||
* frame will have END_STREAM flag set. Usually, this is expected
|
* frame will have END_STREAM flag set. Usually, this is expected
|
||||||
* behaviour and all are fine. One exception is send trailer header
|
* behaviour and all are fine. One exception is send trailer fields.
|
||||||
* fields. You cannot send trailers after sending frame with
|
* You cannot send trailer fields after sending frame with END_STREAM
|
||||||
* END_STREAM set. To avoid this problem, one can set
|
* set. To avoid this problem, one can set
|
||||||
* :enum:`NGHTTP2_DATA_FLAG_NO_END_STREAM` along with
|
* :enum:`NGHTTP2_DATA_FLAG_NO_END_STREAM` along with
|
||||||
* :enum:`NGHTTP2_DATA_FLAG_EOF` to signal the library not to set
|
* :enum:`NGHTTP2_DATA_FLAG_EOF` to signal the library not to set
|
||||||
* END_STREAM in DATA frame. Then application can use
|
* END_STREAM in DATA frame. Then application can use
|
||||||
* `nghttp2_submit_trailer()` to send trailers.
|
* `nghttp2_submit_trailer()` to send trailer fields.
|
||||||
* `nghttp2_submit_trailer()` can be called inside this callback.
|
* `nghttp2_submit_trailer()` can be called inside this callback.
|
||||||
*
|
*
|
||||||
* If the application wants to postpone DATA frames (e.g.,
|
* If the application wants to postpone DATA frames (e.g.,
|
||||||
|
@ -849,9 +849,9 @@ typedef struct {
|
||||||
*
|
*
|
||||||
* The category of HEADERS, which indicates the role of the frame. In
|
* The category of HEADERS, which indicates the role of the frame. In
|
||||||
* HTTP/2 spec, request, response, push response and other arbitrary
|
* HTTP/2 spec, request, response, push response and other arbitrary
|
||||||
* headers (e.g., trailers) are all called just HEADERS. To give the
|
* headers (e.g., trailer fields) are all called just HEADERS. To
|
||||||
* application the role of incoming HEADERS frame, we define several
|
* give the application the role of incoming HEADERS frame, we define
|
||||||
* categories.
|
* several categories.
|
||||||
*/
|
*/
|
||||||
typedef enum {
|
typedef enum {
|
||||||
/**
|
/**
|
||||||
|
@ -1499,7 +1499,7 @@ typedef int (*nghttp2_on_stream_close_callback)(nghttp2_session *session,
|
||||||
* NGHTTP2_HCAT_REQUEST``. If |session| is configured as server side,
|
* NGHTTP2_HCAT_REQUEST``. If |session| is configured as server side,
|
||||||
* ``frame->headers.cat`` is either ``NGHTTP2_HCAT_REQUEST``
|
* ``frame->headers.cat`` is either ``NGHTTP2_HCAT_REQUEST``
|
||||||
* containing request headers or ``NGHTTP2_HCAT_HEADERS`` containing
|
* containing request headers or ``NGHTTP2_HCAT_HEADERS`` containing
|
||||||
* trailer headers and never get PUSH_PROMISE in this callback.
|
* trailer fields and never get PUSH_PROMISE in this callback.
|
||||||
*
|
*
|
||||||
* For the client applications, ``frame->hd.type`` is either
|
* For the client applications, ``frame->hd.type`` is either
|
||||||
* ``NGHTTP2_HEADERS`` or ``NGHTTP2_PUSH_PROMISE``. In case of
|
* ``NGHTTP2_HEADERS`` or ``NGHTTP2_PUSH_PROMISE``. In case of
|
||||||
|
@ -1511,7 +1511,7 @@ typedef int (*nghttp2_on_stream_close_callback)(nghttp2_session *session,
|
||||||
* non-final response code and finally client gets exactly one HEADERS
|
* non-final response code and finally client gets exactly one HEADERS
|
||||||
* 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 fields also has ``frame->headers.cat ==
|
||||||
* NGHTTP2_HCAT_HEADERS`` which does not contain any status code.
|
* NGHTTP2_HCAT_HEADERS`` which does not contain any status code.
|
||||||
*
|
*
|
||||||
* Returning :enum:`NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE` will close
|
* Returning :enum:`NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE` will close
|
||||||
|
@ -3255,7 +3255,7 @@ nghttp2_submit_response(nghttp2_session *session, int32_t stream_id,
|
||||||
/**
|
/**
|
||||||
* @function
|
* @function
|
||||||
*
|
*
|
||||||
* Submits trailer HEADERS against the stream |stream_id|.
|
* Submits trailer fields HEADERS against the stream |stream_id|.
|
||||||
*
|
*
|
||||||
* The |nva| is an array of name/value pair :type:`nghttp2_nv` with
|
* The |nva| is an array of name/value pair :type:`nghttp2_nv` with
|
||||||
* |nvlen| elements. The application is responsible not to include
|
* |nvlen| elements. The application is responsible not to include
|
||||||
|
@ -3274,26 +3274,26 @@ nghttp2_submit_response(nghttp2_session *session, int32_t stream_id,
|
||||||
* :type:`nghttp2_on_frame_send_callback` or
|
* :type:`nghttp2_on_frame_send_callback` or
|
||||||
* :type:`nghttp2_on_frame_not_send_callback` is called.
|
* :type:`nghttp2_on_frame_not_send_callback` is called.
|
||||||
*
|
*
|
||||||
* For server, trailer must be followed by response HEADERS or
|
* For server, trailer fields must follow response HEADERS or response
|
||||||
* response DATA. The library does not check that response HEADERS
|
* DATA with END_STREAM flag set. The library does not enforce this
|
||||||
* has already sent and if `nghttp2_submit_trailer()` is called before
|
* requirement, and applications should do this for themselves. If
|
||||||
* any response HEADERS submission (usually by
|
* `nghttp2_submit_trailer()` is called before any response HEADERS
|
||||||
* `nghttp2_submit_response()`), the content of |nva| will be sent as
|
* submission (usually by `nghttp2_submit_response()`), the content of
|
||||||
* response headers, which will result in error.
|
* |nva| will be sent as response headers, which will result in error.
|
||||||
*
|
*
|
||||||
* This function has the same effect with `nghttp2_submit_headers()`,
|
* This function has the same effect with `nghttp2_submit_headers()`,
|
||||||
* with flags = :enum:`NGHTTP2_FLAG_END_HEADERS` and both pri_spec and
|
* with flags = :enum:`NGHTTP2_FLAG_END_HEADERS` and both pri_spec and
|
||||||
* stream_user_data to NULL.
|
* stream_user_data to NULL.
|
||||||
*
|
*
|
||||||
* To submit trailer after `nghttp2_submit_response()` is called, the
|
* To submit trailer fields after `nghttp2_submit_response()` is
|
||||||
* application has to specify :type:`nghttp2_data_provider` to
|
* called, the application has to specify
|
||||||
* `nghttp2_submit_response()`. In side
|
* :type:`nghttp2_data_provider` to `nghttp2_submit_response()`. In
|
||||||
* :type:`nghttp2_data_source_read_callback`, when setting
|
* side :type:`nghttp2_data_source_read_callback`, when setting
|
||||||
* :enum:`NGHTTP2_DATA_FLAG_EOF`, also set
|
* :enum:`NGHTTP2_DATA_FLAG_EOF`, also set
|
||||||
* :enum:`NGHTTP2_DATA_FLAG_NO_END_STREAM`. After that, the
|
* :enum:`NGHTTP2_DATA_FLAG_NO_END_STREAM`. After that, the
|
||||||
* application can send trailer using `nghttp2_submit_trailer()`.
|
* application can send trailer fields using
|
||||||
* `nghttp2_submit_trailer()` can be used inside
|
* `nghttp2_submit_trailer()`. `nghttp2_submit_trailer()` can be used
|
||||||
* :type:`nghttp2_data_source_read_callback`.
|
* inside :type:`nghttp2_data_source_read_callback`.
|
||||||
*
|
*
|
||||||
* This function returns 0 if it succeeds and |stream_id| is -1.
|
* This function returns 0 if it succeeds and |stream_id| is -1.
|
||||||
* Otherwise, this function returns 0 if it succeeds, or one of the
|
* Otherwise, this function returns 0 if it succeeds, or one of the
|
||||||
|
|
Loading…
Reference in New Issue