From 0f30fb98a980b4ff98ea4600cf90f768c5470964 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 18 Jan 2014 00:35:41 +0900 Subject: [PATCH] Update doc --- lib/includes/nghttp2/nghttp2.h | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/lib/includes/nghttp2/nghttp2.h b/lib/includes/nghttp2/nghttp2.h index 2af1d519..b405050d 100644 --- a/lib/includes/nghttp2/nghttp2.h +++ b/lib/includes/nghttp2/nghttp2.h @@ -870,6 +870,11 @@ typedef ssize_t (*nghttp2_recv_callback) * 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 + * respectively. The header name/value pairs are emitted via + * :type:`nghttp2_on_header_callback`. + * * The implementation of this function must return 0 if it * succeeds. If nonzero value is returned, it is treated as fatal * error and `nghttp2_session_recv()` and `nghttp2_session_mem_recv()` @@ -889,6 +894,14 @@ typedef int (*nghttp2_on_frame_recv_callback) * 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 + * respectively. + * + * If this callback is called, :type:`nghttp2_on_header_callback` and + * :type:`nghttp2_on_end_headers_callback` will not be called for this + * 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 @@ -1154,6 +1167,10 @@ typedef int (*nghttp2_on_header_callback) * will handle the error by either transmitting RST_STREAM or GOAWAY * and terminate session. * + * If the |error_code| is not :enum:`NGHTTP2_NO_ERROR`, then + * :type:`nghttp2_on_request_recv_callback` will not called for this + * frame if the |frame| is HEADERS. + * * The implementation of this function must return 0 if it * succeeds. If nonzero value is returned, it is treated as fatal * error and `nghttp2_session_recv()` and `nghttp2_session_mem_recv()` @@ -1500,7 +1517,12 @@ int nghttp2_session_send(nghttp2_session *session); * one or more times to receive whole frame. * 2. If the received frame is valid, * :member:`nghttp2_session_callbacks.on_frame_recv_callback` is - * invoked. If the frame is the final frame of the request, + * invoked. If frame is either HEADERS or PUSH_PROMISE, + * :member:`nghttp2_session_callbacks.on_header_callback` is + * invoked for each header name/value pair. After all name/value + * pairs are emitted (or decompression failed), + * :member:`nghttp2_session_callbacks.on_end_headers_callback` + * is invoked. If the frame is the final frame of the request, * :member:`nghttp2_session_callbacks.on_request_recv_callback` * is invoked. If the reception of the frame triggers the * closure of the stream,