Commit f52105ea authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

Update doc

parent bcc47178
...@@ -687,13 +687,18 @@ Types (structs, unions and typedefs) ...@@ -687,13 +687,18 @@ Types (structs, unions and typedefs)
:macro:`NGHTTP2_ERR_EOF`. For other errors, it must return :macro:`NGHTTP2_ERR_EOF`. For other errors, it must return
:macro:`NGHTTP2_ERR_CALLBACK_FAILURE`. :macro:`NGHTTP2_ERR_CALLBACK_FAILURE`.
.. type:: typedef void (*nghttp2_on_frame_recv_callback) (nghttp2_session *session, nghttp2_frame *frame, void *user_data) .. type:: typedef int (*nghttp2_on_frame_recv_callback) (nghttp2_session *session, nghttp2_frame *frame, void *user_data)
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 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 :macro:`NGHTTP2_ERR_CALLBACK_FAILURE`.
.. type:: typedef void (*nghttp2_on_invalid_frame_recv_callback) (nghttp2_session *session, nghttp2_frame *frame, nghttp2_error_code error_code, void *user_data) .. type:: typedef int (*nghttp2_on_invalid_frame_recv_callback) (nghttp2_session *session, nghttp2_frame *frame, nghttp2_error_code error_code, void *user_data)
Callback function invoked by `nghttp2_session_recv()` when an Callback function invoked by `nghttp2_session_recv()` when an
...@@ -701,8 +706,13 @@ Types (structs, unions and typedefs) ...@@ -701,8 +706,13 @@ Types (structs, unions and typedefs)
:macro:`nghttp2_error_code` and indicates the error. When this :macro:`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 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 :macro:`NGHTTP2_ERR_CALLBACK_FAILURE`.
.. type:: typedef void (*nghttp2_on_data_chunk_recv_callback) (nghttp2_session *session, uint8_t flags, int32_t stream_id, const uint8_t *data, size_t len, void *user_data) .. type:: typedef int (*nghttp2_on_data_chunk_recv_callback) (nghttp2_session *session, uint8_t flags, int32_t stream_id, const uint8_t *data, size_t len, void *user_data)
Callback function invoked when a chunk of data in DATA frame is Callback function invoked when a chunk of data in DATA frame is
...@@ -712,15 +722,25 @@ Types (structs, unions and typedefs) ...@@ -712,15 +722,25 @@ Types (structs, unions and typedefs)
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 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 :macro:`NGHTTP2_ERR_CALLBACK_FAILURE`.
.. type:: typedef void (*nghttp2_on_data_recv_callback) (nghttp2_session *session, uint16_t length, uint8_t flags, int32_t stream_id, void *user_data) .. type:: typedef int (*nghttp2_on_data_recv_callback) (nghttp2_session *session, uint16_t length, uint8_t flags, int32_t stream_id, void *user_data)
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 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 :macro:`NGHTTP2_ERR_CALLBACK_FAILURE`.
.. type:: typedef void (*nghttp2_before_frame_send_callback) (nghttp2_session *session, nghttp2_frame *frame, void *user_data) .. type:: typedef int (*nghttp2_before_frame_send_callback) (nghttp2_session *session, nghttp2_frame *frame, void *user_data)
Callback function invoked before the non-DATA frame *frame* is Callback function invoked before the non-DATA frame *frame* is
...@@ -728,26 +748,46 @@ Types (structs, unions and typedefs) ...@@ -728,26 +748,46 @@ Types (structs, unions and typedefs)
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 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 :macro:`NGHTTP2_ERR_CALLBACK_FAILURE`.
.. type:: typedef void (*nghttp2_on_frame_send_callback) (nghttp2_session *session, nghttp2_frame *frame, void *user_data) .. type:: typedef int (*nghttp2_on_frame_send_callback) (nghttp2_session *session, nghttp2_frame *frame, void *user_data)
Callback function invoked after the non-DATA frame *frame* is sent. Callback function invoked after the non-DATA frame *frame* is sent.
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 :macro:`NGHTTP2_ERR_CALLBACK_FAILURE`.
.. type:: typedef void (*nghttp2_on_frame_not_send_callback) (nghttp2_session *session, nghttp2_frame *frame, int lib_error_code, void *user_data) .. type:: typedef int (*nghttp2_on_frame_not_send_callback) (nghttp2_session *session, nghttp2_frame *frame, int lib_error_code, void *user_data)
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 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 :macro:`NGHTTP2_ERR_CALLBACK_FAILURE`.
.. type:: typedef void (*nghttp2_on_data_send_callback) (nghttp2_session *session, uint16_t length, uint8_t flags, int32_t stream_id, void *user_data) .. type:: typedef int (*nghttp2_on_data_send_callback) (nghttp2_session *session, uint16_t length, uint8_t flags, int32_t stream_id, void *user_data)
Callback function invoked after DATA frame is sent. Callback function invoked after DATA frame is sent.
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 :macro:`NGHTTP2_ERR_CALLBACK_FAILURE`.
.. type:: typedef void (*nghttp2_on_stream_close_callback) (nghttp2_session *session, int32_t stream_id, nghttp2_error_code error_code, void *user_data) .. type:: typedef int (*nghttp2_on_stream_close_callback) (nghttp2_session *session, int32_t stream_id, nghttp2_error_code error_code, void *user_data)
Callback function invoked when the stream *stream_id* is Callback function invoked when the stream *stream_id* is
...@@ -755,16 +795,26 @@ Types (structs, unions and typedefs) ...@@ -755,16 +795,26 @@ Types (structs, unions and typedefs)
*error_code*. The stream_user_data, which was specified in *error_code*. The stream_user_data, which was specified in
`nghttp2_submit_request()` or `nghttp2_submit_headers()`, is `nghttp2_submit_request()` or `nghttp2_submit_headers()`, is
still available in this function. still available in this function.
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 :macro:`NGHTTP2_ERR_CALLBACK_FAILURE`.
.. type:: typedef void (*nghttp2_on_request_recv_callback) (nghttp2_session *session, int32_t stream_id, void *user_data) .. type:: typedef int (*nghttp2_on_request_recv_callback) (nghttp2_session *session, int32_t stream_id, void *user_data)
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 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 :macro:`NGHTTP2_ERR_CALLBACK_FAILURE`.
.. type:: typedef void (*nghttp2_on_frame_recv_parse_error_callback) (nghttp2_session *session, nghttp2_frame_type type, const uint8_t *head, size_t headlen, const uint8_t *payload, size_t payloadlen, int lib_error_code, void *user_data) .. type:: typedef int (*nghttp2_on_frame_recv_parse_error_callback) (nghttp2_session *session, nghttp2_frame_type type, const uint8_t *head, size_t headlen, const uint8_t *payload, size_t payloadlen, int lib_error_code, void *user_data)
Callback function invoked when the received control frame octets Callback function invoked when the received control frame octets
...@@ -777,8 +827,13 @@ Types (structs, unions and typedefs) ...@@ -777,8 +827,13 @@ Types (structs, unions and typedefs)
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 code
defined in :macro:`nghttp2_error` and indicates the error. defined in :macro:`nghttp2_error` and indicates the error.
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 :macro:`NGHTTP2_ERR_CALLBACK_FAILURE`.
.. type:: typedef void (*nghttp2_on_unknown_frame_recv_callback) (nghttp2_session *session, const uint8_t *head, size_t headlen, const uint8_t *payload, size_t payloadlen, void *user_data) .. type:: typedef int (*nghttp2_on_unknown_frame_recv_callback) (nghttp2_session *session, const uint8_t *head, size_t headlen, const uint8_t *payload, size_t payloadlen, void *user_data)
Callback function invoked when the received frame type is Callback function invoked when the received frame type is
...@@ -788,6 +843,11 @@ Types (structs, unions and typedefs) ...@@ -788,6 +843,11 @@ Types (structs, unions and typedefs)
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 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 :macro:`NGHTTP2_ERR_CALLBACK_FAILURE`.
.. type:: nghttp2_session_callbacks .. type:: nghttp2_session_callbacks
......
This diff is collapsed.
No preview for this file type
...@@ -107,10 +107,12 @@ header compression ...@@ -107,10 +107,12 @@ header compression
implementation. These endpoints supports <tt class="docutils literal"><span class="pre">HTTP-draft-06/2.0</span></tt> and implementation. These endpoints supports <tt class="docutils literal"><span class="pre">HTTP-draft-06/2.0</span></tt> and
the earlier draft versions are not supporeted.</p> the earlier draft versions are not supporeted.</p>
<ul> <ul>
<li><p class="first"><a class="reference external" href="https://106.186.112.116:8443">https://106.186.112.116:8443</a> TLS + NPN</p> <li><p class="first"><a class="reference external" href="https://106.186.112.116">https://106.186.112.116</a> (TLS + NPN)</p>
<p>NPN offers <tt class="docutils literal"><span class="pre">HTTP-draft-06/2.0</span></tt>, <tt class="docutils literal"><span class="pre">spdy/3</span></tt>, <tt class="docutils literal"><span class="pre">spdy/2</span></tt> and
<tt class="docutils literal"><span class="pre">http/1.1</span></tt>.</p>
<p>Note: certificate is self-signed and a browser will show alert</p> <p>Note: certificate is self-signed and a browser will show alert</p>
</li> </li>
<li><p class="first"><a class="reference external" href="http://106.186.112.116:8080">http://106.186.112.116:8080</a> direct, HTTP Upgrade</p> <li><p class="first"><a class="reference external" href="http://106.186.112.116">http://106.186.112.116</a> (Upgrade + Direct)</p>
</li> </li>
</ul> </ul>
</div> </div>
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment