From 3086d65657ef24fb8b3f8f51e9d0d9bf85131791 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 9 Apr 2016 19:20:07 +0900 Subject: [PATCH] altsvc: Update doc --- doc/sources/index.rst | 1 + lib/includes/nghttp2/nghttp2.h | 27 +++++++++++++++++++++++---- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/doc/sources/index.rst b/doc/sources/index.rst index e3205dae..c8f688d3 100644 --- a/doc/sources/index.rst +++ b/doc/sources/index.rst @@ -51,3 +51,4 @@ Resources * HTTP/2 https://tools.ietf.org/html/rfc7540 * HPACK https://tools.ietf.org/html/rfc7541 +* HTTP Alternative Services https://tools.ietf.org/html/rfc7838 diff --git a/lib/includes/nghttp2/nghttp2.h b/lib/includes/nghttp2/nghttp2.h index 99562beb..c9609051 100644 --- a/lib/includes/nghttp2/nghttp2.h +++ b/lib/includes/nghttp2/nghttp2.h @@ -593,7 +593,8 @@ typedef enum { */ NGHTTP2_CONTINUATION = 0x09, /** - * The ALTSVC frame. + * The ALTSVC frame, which is defined in `RFC 7383 + * `_. */ NGHTTP2_ALTSVC = 0x0a } nghttp2_frame_type; @@ -2378,7 +2379,7 @@ nghttp2_option_set_user_recv_extension_type(nghttp2_option *option, uint8_t type); /** - * @ function + * @function * * Sets extension frame type the application is willing to receive * using builtin handler. The |type| is the extension frame type to @@ -4140,8 +4141,8 @@ NGHTTP2_EXTERN int nghttp2_submit_extension(nghttp2_session *session, /** * @struct * - * The payload of ALTSVC frame. ALTSVC frame is one of extension - * frame. If this frame is received, and + * The payload of ALTSVC frame. ALTSVC frame is a non-critical + * extension to HTTP/2. If this frame is received, and * `nghttp2_option_set_user_recv_extension_type()` is not set, and * `nghttp2_option_set_builtin_recv_extension_type()` is set for * :enum:`NGHTTP2_ALTSVC`, ``nghttp2_extension.payload`` will point to @@ -4150,9 +4151,23 @@ NGHTTP2_EXTERN int nghttp2_submit_extension(nghttp2_session *session, * It has the following members: */ typedef struct { + /** + * The pointer to origin which this alternative service is + * associated with. This is not necessarily NULL-terminated. + */ uint8_t *origin; + /** + * The length of the |origin|. + */ size_t origin_len; + /** + * The pointer to Alt-Svc field value contained in ALTSVC frame. + * This is not necessarily NULL-terminated. + */ uint8_t *field_value; + /** + * The length of the |field_value|. + */ size_t field_value_len; } nghttp2_ext_altsvc; @@ -4161,6 +4176,10 @@ typedef struct { * * Submits ALTSVC frame. * + * ALTSVC frame is a non-critical extension to HTTP/2, and defined in + * is defined in `RFC 7383 + * `_. + * * The |flags| is currently ignored and should be * :enum:`NGHTTP2_FLAG_NONE`. *