Open
update to version 1.62.1 #59
Venland1Add on Jul 5, 2024
update to version 1.62.1 #59
Open
Merged fromrefs/pull/59/headintomaster
Total: 5 files changed+8-205
| @@ -1,98 +0,0 @@ | |||
| 1 | -From d71a4668c6bead55805d18810d633fbb98315af9 Mon Sep 17 00:00:00 2001 | ||
| 2 | -From: Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | ||
| 3 | -Date: Sat, 9 Mar 2024 16:48:10 +0900 | ||
| 4 | -Subject: [PATCH] Add nghttp2_option_set_max_continuations | ||
| 5 | - | ||
| 6 | ---- | ||
| 7 | - doc/Makefile.am | 1 + | ||
| 8 | - lib/includes/nghttp2/nghttp2.h | 11 +++++++++++ | ||
| 9 | - lib/nghttp2_option.c | 5 +++++ | ||
| 10 | - lib/nghttp2_option.h | 5 +++++ | ||
| 11 | - lib/nghttp2_session.c | 4 ++++ | ||
| 12 | - 5 files changed, 26 insertions(+) | ||
| 13 | - | ||
| 14 | -diff --git a/doc/Makefile.am b/doc/Makefile.am | ||
| 15 | -index 51945e4f0b..50d57b2217 100644 | ||
| 16 | ---- a/doc/Makefile.am | ||
| 17 | -+++ b/doc/Makefile.am | ||
| 18 | -@@ -73,6 +73,7 @@ APIDOCS= \ | ||
| 19 | - nghttp2_option_set_peer_max_concurrent_streams.rst \ | ||
| 20 | - nghttp2_option_set_server_fallback_rfc7540_priorities.rst \ | ||
| 21 | - nghttp2_option_set_user_recv_extension_type.rst \ | ||
| 22 | -+ nghttp2_option_set_max_continuations.rst \ | ||
| 23 | - nghttp2_option_set_max_outbound_ack.rst \ | ||
| 24 | - nghttp2_option_set_max_settings.rst \ | ||
| 25 | - nghttp2_option_set_stream_reset_rate_limit.rst \ | ||
| 26 | -diff --git a/lib/includes/nghttp2/nghttp2.h b/lib/includes/nghttp2/nghttp2.h | ||
| 27 | -index a9629c7823..92c3ccc6e4 100644 | ||
| 28 | ---- a/lib/includes/nghttp2/nghttp2.h | ||
| 29 | -+++ b/lib/includes/nghttp2/nghttp2.h | ||
| 30 | -@@ -2778,6 +2778,17 @@ NGHTTP2_EXTERN void | ||
| 31 | - nghttp2_option_set_stream_reset_rate_limit(nghttp2_option *option, | ||
| 32 | - uint64_t burst, uint64_t rate); | ||
| 33 | - | ||
| 34 | -+/** | ||
| 35 | -+ * @function | ||
| 36 | -+ * | ||
| 37 | -+ * This function sets the maximum number of CONTINUATION frames | ||
| 38 | -+ * following an incoming HEADER frame. If more than those frames are | ||
| 39 | -+ * received, the remote endpoint is considered to be misbehaving and | ||
| 40 | -+ * session will be closed. The default value is 8. | ||
| 41 | -+ */ | ||
| 42 | -+NGHTTP2_EXTERN void nghttp2_option_set_max_continuations(nghttp2_option *option, | ||
| 43 | -+ size_t val); | ||
| 44 | -+ | ||
| 45 | - /** | ||
| 46 | - * @function | ||
| 47 | - * | ||
| 48 | -diff --git a/lib/nghttp2_option.c b/lib/nghttp2_option.c | ||
| 49 | -index 43d4e95229..53144b9b75 100644 | ||
| 50 | ---- a/lib/nghttp2_option.c | ||
| 51 | -+++ b/lib/nghttp2_option.c | ||
| 52 | -@@ -150,3 +150,8 @@ void nghttp2_option_set_stream_reset_rate_limit(nghttp2_option *option, | ||
| 53 | - option->stream_reset_burst = burst; | ||
| 54 | - option->stream_reset_rate = rate; | ||
| 55 | - } | ||
| 56 | -+ | ||
| 57 | -+void nghttp2_option_set_max_continuations(nghttp2_option *option, size_t val) { | ||
| 58 | -+ option->opt_set_mask |= NGHTTP2_OPT_MAX_CONTINUATIONS; | ||
| 59 | -+ option->max_continuations = val; | ||
| 60 | -+} | ||
| 61 | -diff --git a/lib/nghttp2_option.h b/lib/nghttp2_option.h | ||
| 62 | -index 2259e1849d..c89cb97f8b 100644 | ||
| 63 | ---- a/lib/nghttp2_option.h | ||
| 64 | -+++ b/lib/nghttp2_option.h | ||
| 65 | -@@ -71,6 +71,7 @@ typedef enum { | ||
| 66 | - NGHTTP2_OPT_SERVER_FALLBACK_RFC7540_PRIORITIES = 1 << 13, | ||
| 67 | - NGHTTP2_OPT_NO_RFC9113_LEADING_AND_TRAILING_WS_VALIDATION = 1 << 14, | ||
| 68 | - NGHTTP2_OPT_STREAM_RESET_RATE_LIMIT = 1 << 15, | ||
| 69 | -+ NGHTTP2_OPT_MAX_CONTINUATIONS = 1 << 16, | ||
| 70 | - } nghttp2_option_flag; | ||
| 71 | - | ||
| 72 | - /** | ||
| 73 | -@@ -98,6 +99,10 @@ struct nghttp2_option { | ||
| 74 | - * NGHTTP2_OPT_MAX_SETTINGS | ||
| 75 | - */ | ||
| 76 | - size_t max_settings; | ||
| 77 | -+ /** | ||
| 78 | -+ * NGHTTP2_OPT_MAX_CONTINUATIONS | ||
| 79 | -+ */ | ||
| 80 | -+ size_t max_continuations; | ||
| 81 | - /** | ||
| 82 | - * Bitwise OR of nghttp2_option_flag to determine that which fields | ||
| 83 | - * are specified. | ||
| 84 | -diff --git a/lib/nghttp2_session.c b/lib/nghttp2_session.c | ||
| 85 | -index fc4c77a3f0..004a4dffaa 100644 | ||
| 86 | ---- a/lib/nghttp2_session.c | ||
| 87 | -+++ b/lib/nghttp2_session.c | ||
| 88 | -@@ -585,6 +585,10 @@ static int session_new(nghttp2_session **session_ptr, | ||
| 89 | - option->stream_reset_burst, | ||
| 90 | - option->stream_reset_rate); | ||
| 91 | - } | ||
| 92 | -+ | ||
| 93 | -+ if (option->opt_set_mask & NGHTTP2_OPT_MAX_CONTINUATIONS) { | ||
| 94 | -+ (*session_ptr)->max_continuations = option->max_continuations; | ||
| 95 | -+ } | ||
| 96 | - } | ||
| 97 | - | ||
| 98 | - rv = nghttp2_hd_deflate_init2(&(*session_ptr)->hd_deflater, | ||
Binary files do not support preview
Binary files do not support preview