aboutsummaryrefslogtreecommitdiff
path: root/deps/nghttp2/lib/includes
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2018-09-02 12:00:41 +0200
committerDaniel Bevenius <daniel.bevenius@gmail.com>2018-09-05 10:43:09 +0200
commite0071660090035deadf536e0c25b4a7c42e1a5a5 (patch)
tree330fb67bc09a55e1fd4a7a2e25ffdc6fb2114f90 /deps/nghttp2/lib/includes
parentb4f5cdc6c490bd6ce2ca529b57a7b215bc6a3385 (diff)
downloadandroid-node-v8-e0071660090035deadf536e0c25b4a7c42e1a5a5.tar.gz
android-node-v8-e0071660090035deadf536e0c25b4a7c42e1a5a5.tar.bz2
android-node-v8-e0071660090035deadf536e0c25b4a7c42e1a5a5.zip
deps: update to nghttp2 1.33.0
Refs: https://github.com/nghttp2/nghttp2/releases/tag/v1.33.0 PR-URL: https://github.com/nodejs/node/pull/22649 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Diffstat (limited to 'deps/nghttp2/lib/includes')
-rw-r--r--deps/nghttp2/lib/includes/nghttp2/nghttp2.h142
-rw-r--r--deps/nghttp2/lib/includes/nghttp2/nghttp2ver.h4
2 files changed, 114 insertions, 32 deletions
diff --git a/deps/nghttp2/lib/includes/nghttp2/nghttp2.h b/deps/nghttp2/lib/includes/nghttp2/nghttp2.h
index 14f8950bed..8c54b9c8cc 100644
--- a/deps/nghttp2/lib/includes/nghttp2/nghttp2.h
+++ b/deps/nghttp2/lib/includes/nghttp2/nghttp2.h
@@ -28,7 +28,7 @@
/* Define WIN32 when build target is Win32 API (borrowed from
libcurl) */
#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
-#define WIN32
+# define WIN32
#endif
#ifdef __cplusplus
@@ -40,9 +40,9 @@ extern "C" {
/* MSVC < 2013 does not have inttypes.h because it is not C99
compliant. See compiler macros and version number in
https://sourceforge.net/p/predef/wiki/Compilers/ */
-#include <stdint.h>
+# include <stdint.h>
#else /* !defined(_MSC_VER) || (_MSC_VER >= 1800) */
-#include <inttypes.h>
+# include <inttypes.h>
#endif /* !defined(_MSC_VER) || (_MSC_VER >= 1800) */
#include <sys/types.h>
#include <stdarg.h>
@@ -50,20 +50,20 @@ extern "C" {
#include <nghttp2/nghttp2ver.h>
#ifdef NGHTTP2_STATICLIB
-#define NGHTTP2_EXTERN
+# define NGHTTP2_EXTERN
#elif defined(WIN32)
-#ifdef BUILDING_NGHTTP2
-#define NGHTTP2_EXTERN __declspec(dllexport)
-#else /* !BUILDING_NGHTTP2 */
-#define NGHTTP2_EXTERN __declspec(dllimport)
-#endif /* !BUILDING_NGHTTP2 */
-#else /* !defined(WIN32) */
-#ifdef BUILDING_NGHTTP2
-#define NGHTTP2_EXTERN __attribute__((visibility("default")))
-#else /* !BUILDING_NGHTTP2 */
-#define NGHTTP2_EXTERN
-#endif /* !BUILDING_NGHTTP2 */
-#endif /* !defined(WIN32) */
+# ifdef BUILDING_NGHTTP2
+# define NGHTTP2_EXTERN __declspec(dllexport)
+# else /* !BUILDING_NGHTTP2 */
+# define NGHTTP2_EXTERN __declspec(dllimport)
+# endif /* !BUILDING_NGHTTP2 */
+#else /* !defined(WIN32) */
+# ifdef BUILDING_NGHTTP2
+# define NGHTTP2_EXTERN __attribute__((visibility("default")))
+# else /* !BUILDING_NGHTTP2 */
+# define NGHTTP2_EXTERN
+# endif /* !BUILDING_NGHTTP2 */
+#endif /* !defined(WIN32) */
/**
* @macro
@@ -611,7 +611,12 @@ typedef enum {
* The ALTSVC frame, which is defined in `RFC 7383
* <https://tools.ietf.org/html/rfc7838#section-4>`_.
*/
- NGHTTP2_ALTSVC = 0x0a
+ NGHTTP2_ALTSVC = 0x0a,
+ /**
+ * The ORIGIN frame, which is defined by `RFC 8336
+ * <https://tools.ietf.org/html/rfc8336>`_.
+ */
+ NGHTTP2_ORIGIN = 0x0c
} nghttp2_frame_type;
/**
@@ -2473,15 +2478,15 @@ nghttp2_option_set_no_auto_window_update(nghttp2_option *option, int val);
*
* This option sets the SETTINGS_MAX_CONCURRENT_STREAMS value of
* remote endpoint as if it is received in SETTINGS frame. Without
- * specifying this option, before the local endpoint receives
- * SETTINGS_MAX_CONCURRENT_STREAMS in SETTINGS frame from remote
- * endpoint, SETTINGS_MAX_CONCURRENT_STREAMS is unlimited. This may
- * cause problem if local endpoint submits lots of requests initially
- * and sending them at once to the remote peer may lead to the
- * rejection of some requests. Specifying this option to the sensible
- * value, say 100, may avoid this kind of issue. This value will be
- * overwritten if the local endpoint receives
- * SETTINGS_MAX_CONCURRENT_STREAMS from the remote endpoint.
+ * specifying this option, the maximum number of outgoing concurrent
+ * streams is initially limited to 100 to avoid issues when the local
+ * endpoint submits lots of requests before receiving initial SETTINGS
+ * frame from the remote endpoint, since sending them at once to the
+ * remote endpoint could lead to rejection of some of the requests.
+ * This value will be overwritten when the local endpoint receives
+ * initial SETTINGS frame from the remote endpoint, either to the
+ * value advertised in SETTINGS_MAX_CONCURRENT_STREAMS or to the
+ * default value (unlimited) if none was advertised.
*/
NGHTTP2_EXTERN void
nghttp2_option_set_peer_max_concurrent_streams(nghttp2_option *option,
@@ -3797,10 +3802,13 @@ nghttp2_priority_spec_check_default(const nghttp2_priority_spec *pri_spec);
* .. warning::
*
* This function returns assigned stream ID if it succeeds. But
- * that stream is not opened yet. The application must not submit
+ * that stream is not created yet. The application must not submit
* frame to that stream ID before
* :type:`nghttp2_before_frame_send_callback` is called for this
- * frame.
+ * frame. This means `nghttp2_session_get_stream_user_data()` does
+ * not work before the callback. But
+ * `nghttp2_session_set_stream_user_data()` handles this situation
+ * specially, and it can set data to a stream during this period.
*
*/
NGHTTP2_EXTERN int32_t nghttp2_submit_request(
@@ -4516,8 +4524,7 @@ typedef struct {
* Submits ALTSVC frame.
*
* ALTSVC frame is a non-critical extension to HTTP/2, and defined in
- * is defined in `RFC 7383
- * <https://tools.ietf.org/html/rfc7838#section-4>`_.
+ * `RFC 7383 <https://tools.ietf.org/html/rfc7838#section-4>`_.
*
* The |flags| is currently ignored and should be
* :enum:`NGHTTP2_FLAG_NONE`.
@@ -4552,6 +4559,81 @@ NGHTTP2_EXTERN int nghttp2_submit_altsvc(nghttp2_session *session,
size_t field_value_len);
/**
+ * @struct
+ *
+ * The single entry of an origin.
+ */
+typedef struct {
+ /**
+ * The pointer to origin. No validation is made against this field
+ * by the library. This is not necessarily NULL-terminated.
+ */
+ uint8_t *origin;
+ /**
+ * The length of the |origin|.
+ */
+ size_t origin_len;
+} nghttp2_origin_entry;
+
+/**
+ * @struct
+ *
+ * The payload of ORIGIN frame. ORIGIN frame is a non-critical
+ * extension to HTTP/2 and defined by `RFC 8336
+ * <https://tools.ietf.org/html/rfc8336>`_.
+ *
+ * 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_ORIGIN`, ``nghttp2_extension.payload`` will point to
+ * this struct.
+ *
+ * It has the following members:
+ */
+typedef struct {
+ /**
+ * The number of origins contained in |ov|.
+ */
+ size_t nov;
+ /**
+ * The pointer to the array of origins contained in ORIGIN frame.
+ */
+ nghttp2_origin_entry *ov;
+} nghttp2_ext_origin;
+
+/**
+ * @function
+ *
+ * Submits ORIGIN frame.
+ *
+ * ORIGIN frame is a non-critical extension to HTTP/2 and defined by
+ * `RFC 8336 <https://tools.ietf.org/html/rfc8336>`_.
+ *
+ * The |flags| is currently ignored and should be
+ * :enum:`NGHTTP2_FLAG_NONE`.
+ *
+ * The |ov| points to the array of origins. The |nov| specifies the
+ * number of origins included in |ov|. This function creates copies
+ * of all elements in |ov|.
+ *
+ * The ORIGIN frame is only usable by a server. If this function is
+ * invoked with client side session, this function returns
+ * :enum:`NGHTTP2_ERR_INVALID_STATE`.
+ *
+ * :enum:`NGHTTP2_ERR_NOMEM`
+ * Out of memory
+ * :enum:`NGHTTP2_ERR_INVALID_STATE`
+ * The function is called from client side session.
+ * :enum:`NGHTTP2_ERR_INVALID_ARGUMENT`
+ * There are too many origins, or an origin is too large to fit
+ * into a default frame payload.
+ */
+NGHTTP2_EXTERN int nghttp2_submit_origin(nghttp2_session *session,
+ uint8_t flags,
+ const nghttp2_origin_entry *ov,
+ size_t nov);
+
+/**
* @function
*
* Compares ``lhs->name`` of length ``lhs->namelen`` bytes and
diff --git a/deps/nghttp2/lib/includes/nghttp2/nghttp2ver.h b/deps/nghttp2/lib/includes/nghttp2/nghttp2ver.h
index d32d275444..1f1d4808ca 100644
--- a/deps/nghttp2/lib/includes/nghttp2/nghttp2ver.h
+++ b/deps/nghttp2/lib/includes/nghttp2/nghttp2ver.h
@@ -29,7 +29,7 @@
* @macro
* Version number of the nghttp2 library release
*/
-#define NGHTTP2_VERSION "1.32.0"
+#define NGHTTP2_VERSION "1.33.0"
/**
* @macro
@@ -37,6 +37,6 @@
* release. This is a 24 bit number with 8 bits for major number, 8 bits
* for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203.
*/
-#define NGHTTP2_VERSION_NUM 0x012000
+#define NGHTTP2_VERSION_NUM 0x012100
#endif /* NGHTTP2VER_H */