| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -47,7 +47,29 @@ if(WIN32) | |||
| 47 | 47 | set(NGHTTP2_RES ${CMAKE_CURRENT_BINARY_DIR}/version.rc) | |
| 48 | 48 | endif() | |
| 49 | 49 | ||
| 50 | - set(EXPORT_SET "${PROJECT_NAME}-targets") | ||
| 50 | + set(NGHTTP2_GENERATED_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated") | ||
| 51 | + set(NGHTTP2_VERSION_CONFIG "${NGHTTP2_GENERATED_DIR}/${PROJECT_NAME}ConfigVersion.cmake") | ||
| 52 | + set(NGHTTP2_PROJECT_CONFIG "${NGHTTP2_GENERATED_DIR}/${PROJECT_NAME}Config.cmake") | ||
| 53 | + set(NGHTTP2_TARGETS_EXPORT_NAME "${PROJECT_NAME}Targets") | ||
| 54 | + set(NGHTTP2_CONFIG_INSTALL_DIR "lib/cmake/${PROJECT_NAME}") | ||
| 55 | + set(NGHTTP2_NAMESPACE "${PROJECT_NAME}::") | ||
| 56 | + set(NGHTTP2_VERSION ${PROJECT_VERSION}) | ||
| 57 | + | ||
| 58 | + include(CMakePackageConfigHelpers) | ||
| 59 | + write_basic_package_version_file( | ||
| 60 | + "${NGHTTP2_VERSION_CONFIG}" VERSION ${NGHTTP2_VERSION} COMPATIBILITY SameMajorVersion | ||
| 61 | + ) | ||
| 62 | + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/config.cmake.in" "${NGHTTP2_PROJECT_CONFIG}" @ONLY) | ||
| 63 | + | ||
| 64 | + # Install cmake config files | ||
| 65 | + install( | ||
| 66 | + FILES "${NGHTTP2_PROJECT_CONFIG}" "${NGHTTP2_VERSION_CONFIG}" | ||
| 67 | + DESTINATION "${NGHTTP2_CONFIG_INSTALL_DIR}") | ||
| 68 | + | ||
| 69 | + install( | ||
| 70 | + EXPORT "${NGHTTP2_TARGETS_EXPORT_NAME}" | ||
| 71 | + NAMESPACE "${NGHTTP2_NAMESPACE}" | ||
| 72 | + DESTINATION "${NGHTTP2_CONFIG_INSTALL_DIR}") | ||
| 51 | 73 | ||
| 52 | 74 | # Public shared library | |
| 53 | 75 | if(BUILD_SHARED_LIBS) | |
@@ -65,7 +87,11 @@ if(BUILD_SHARED_LIBS) | |||
| 65 | 87 | $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> | |
| 66 | 88 | ) | |
| 67 | 89 | ||
| 68 | - install(TARGETS ${SHARED_LIB} EXPORT ${EXPORT_SET}) | ||
| 90 | + install(TARGETS ${SHARED_LIB} | ||
| 91 | + EXPORT ${NGHTTP2_TARGETS_EXPORT_NAME} | ||
| 92 | + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" | ||
| 93 | + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" | ||
| 94 | + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") | ||
| 69 | 95 | list(APPEND nghttp2_exports ${SHARED_LIB}) | |
| 70 | 96 | endif() | |
| 71 | 97 | ||
@@ -87,7 +113,9 @@ if(BUILD_STATIC_LIBS) | |||
| 87 | 113 | ||
| 88 | 114 | target_compile_definitions(${STATIC_LIB} PUBLIC "-DNGHTTP2_STATICLIB") | |
| 89 | 115 | ||
| 90 | - install(TARGETS ${STATIC_LIB} EXPORT ${EXPORT_SET}) | ||
| 116 | + install(TARGETS ${STATIC_LIB} | ||
| 117 | + EXPORT ${NGHTTP2_TARGETS_EXPORT_NAME} | ||
| 118 | + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}") | ||
| 91 | 119 | list(APPEND nghttp2_exports ${STATIC_LIB}) | |
| 92 | 120 | endif() | |
| 93 | 121 | ||
@@ -97,11 +125,7 @@ else() | |||
| 97 | 125 | set(LIB_SELECTED ${STATIC_LIB}) | |
| 98 | 126 | endif() | |
| 99 | 127 | ||
| 100 | - add_library(${PROJECT_NAME}::nghttp2 ALIAS ${LIB_SELECTED}) | ||
| 128 | + add_library(nghttp2 ALIAS ${LIB_SELECTED}) | ||
| 101 | 129 | ||
| 102 | 130 | install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libnghttp2.pc" | |
| 103 | 131 | DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") | |
| 104 | - | ||
| 105 | - install(EXPORT ${EXPORT_SET} | ||
| 106 | - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} | ||
| 107 | - NAMESPACE ${PROJECT_NAME}::) | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,7 +22,7 @@ | |||
| 22 | 22 | # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |
| 23 | 23 | SUBDIRS = includes | |
| 24 | 24 | ||
| 25 | - EXTRA_DIST = Makefile.msvc CMakeLists.txt version.rc.in | ||
| 25 | + EXTRA_DIST = Makefile.msvc CMakeLists.txt version.rc.in config.cmake.in | ||
| 26 | 26 | ||
| 27 | 27 | AM_CFLAGS = $(WARNCFLAGS) $(EXTRACFLAG) | |
| 28 | 28 | AM_CPPFLAGS = -I$(srcdir)/includes -I$(builddir)/includes -DBUILDING_NGHTTP2 \ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -360,6 +360,8 @@ LIBNGHTTP3_LIBS = @LIBNGHTTP3_LIBS@ | |||
| 360 | 360 | LIBNGTCP2_CFLAGS = @LIBNGTCP2_CFLAGS@ | |
| 361 | 361 | LIBNGTCP2_CRYPTO_BORINGSSL_CFLAGS = @LIBNGTCP2_CRYPTO_BORINGSSL_CFLAGS@ | |
| 362 | 362 | LIBNGTCP2_CRYPTO_BORINGSSL_LIBS = @LIBNGTCP2_CRYPTO_BORINGSSL_LIBS@ | |
| 363 | + LIBNGTCP2_CRYPTO_LIBRESSL_CFLAGS = @LIBNGTCP2_CRYPTO_LIBRESSL_CFLAGS@ | ||
| 364 | + LIBNGTCP2_CRYPTO_LIBRESSL_LIBS = @LIBNGTCP2_CRYPTO_LIBRESSL_LIBS@ | ||
| 363 | 365 | LIBNGTCP2_CRYPTO_OSSL_CFLAGS = @LIBNGTCP2_CRYPTO_OSSL_CFLAGS@ | |
| 364 | 366 | LIBNGTCP2_CRYPTO_OSSL_LIBS = @LIBNGTCP2_CRYPTO_OSSL_LIBS@ | |
| 365 | 367 | LIBNGTCP2_CRYPTO_QUICTLS_CFLAGS = @LIBNGTCP2_CRYPTO_QUICTLS_CFLAGS@ | |
@@ -494,7 +496,7 @@ top_srcdir = @top_srcdir@ | |||
| 494 | 496 | # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | |
| 495 | 497 | # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |
| 496 | 498 | SUBDIRS = includes | |
| 497 | - EXTRA_DIST = Makefile.msvc CMakeLists.txt version.rc.in | ||
| 499 | + EXTRA_DIST = Makefile.msvc CMakeLists.txt version.rc.in config.cmake.in | ||
| 498 | 500 | AM_CFLAGS = $(WARNCFLAGS) $(EXTRACFLAG) | |
| 499 | 501 | AM_CPPFLAGS = -I$(srcdir)/includes -I$(builddir)/includes -DBUILDING_NGHTTP2 \ | |
| 500 | 502 | @DEFS@ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,3 @@ | |||
| 1 | + include(CMakeFindDependencyMacro) | ||
| 2 | + | ||
| 3 | + include("${CMAKE_CURRENT_LIST_DIR}/@NGHTTP2_TARGETS_EXPORT_NAME@.cmake") | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -265,6 +265,8 @@ LIBNGHTTP3_LIBS = @LIBNGHTTP3_LIBS@ | |||
| 265 | 265 | LIBNGTCP2_CFLAGS = @LIBNGTCP2_CFLAGS@ | |
| 266 | 266 | LIBNGTCP2_CRYPTO_BORINGSSL_CFLAGS = @LIBNGTCP2_CRYPTO_BORINGSSL_CFLAGS@ | |
| 267 | 267 | LIBNGTCP2_CRYPTO_BORINGSSL_LIBS = @LIBNGTCP2_CRYPTO_BORINGSSL_LIBS@ | |
| 268 | + LIBNGTCP2_CRYPTO_LIBRESSL_CFLAGS = @LIBNGTCP2_CRYPTO_LIBRESSL_CFLAGS@ | ||
| 269 | + LIBNGTCP2_CRYPTO_LIBRESSL_LIBS = @LIBNGTCP2_CRYPTO_LIBRESSL_LIBS@ | ||
| 268 | 270 | LIBNGTCP2_CRYPTO_OSSL_CFLAGS = @LIBNGTCP2_CRYPTO_OSSL_CFLAGS@ | |
| 269 | 271 | LIBNGTCP2_CRYPTO_OSSL_LIBS = @LIBNGTCP2_CRYPTO_OSSL_LIBS@ | |
| 270 | 272 | LIBNGTCP2_CRYPTO_QUICTLS_CFLAGS = @LIBNGTCP2_CRYPTO_QUICTLS_CFLAGS@ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2039,18 +2039,19 @@ typedef int (*nghttp2_on_header_callback2)(nghttp2_session *session, | |||
| 2039 | 2039 | /** | |
| 2040 | 2040 | * @functypedef | |
| 2041 | 2041 | * | |
| 2042 | - * Callback function invoked when a invalid header name/value pair is | ||
| 2042 | + * Callback function invoked when an invalid header name/value pair is | ||
| 2043 | 2043 | * received for the |frame|. | |
| 2044 | 2044 | * | |
| 2045 | 2045 | * The parameter and behaviour are similar to | |
| 2046 | 2046 | * :type:`nghttp2_on_header_callback`. The difference is that this | |
| 2047 | - * callback is only invoked when a invalid header name/value pair is | ||
| 2048 | - * received which is treated as stream error if this callback is not | ||
| 2049 | - * set. Only invalid regular header field are passed to this | ||
| 2050 | - * callback. In other words, invalid pseudo header field is not | ||
| 2051 | - * passed to this callback. Also header fields which includes upper | ||
| 2052 | - * cased latter are also treated as error without passing them to this | ||
| 2053 | - * callback. | ||
| 2047 | + * callback is only invoked when an invalid header name/value pair is | ||
| 2048 | + * received which is treated as stream error if this callback returns | ||
| 2049 | + * :enum:`nghttp2_error.NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE` and | ||
| 2050 | + * :type:`nghttp2_on_invalid_header_callback2` is not set. Only | ||
| 2051 | + * invalid regular header field are passed to this callback. In other | ||
| 2052 | + * words, invalid pseudo header field is not passed to this callback. | ||
| 2053 | + * Also header fields which includes upper cased latter are also | ||
| 2054 | + * treated as error without passing them to this callback. | ||
| 2054 | 2055 | * | |
| 2055 | 2056 | * This callback is only considered if HTTP messaging validation is | |
| 2056 | 2057 | * turned on (which is on by default, see | |
@@ -2076,17 +2077,18 @@ typedef int (*nghttp2_on_invalid_header_callback)( | |||
| 2076 | 2077 | /** | |
| 2077 | 2078 | * @functypedef | |
| 2078 | 2079 | * | |
| 2079 | - * Callback function invoked when a invalid header name/value pair is | ||
| 2080 | + * Callback function invoked when an invalid header name/value pair is | ||
| 2080 | 2081 | * received for the |frame|. | |
| 2081 | 2082 | * | |
| 2082 | 2083 | * The parameter and behaviour are similar to | |
| 2083 | 2084 | * :type:`nghttp2_on_header_callback2`. The difference is that this | |
| 2084 | - * callback is only invoked when a invalid header name/value pair is | ||
| 2085 | - * received which is silently ignored if this callback is not set. | ||
| 2086 | - * Only invalid regular header field are passed to this callback. In | ||
| 2087 | - * other words, invalid pseudo header field is not passed to this | ||
| 2088 | - * callback. Also header fields which includes upper cased latter are | ||
| 2089 | - * also treated as error without passing them to this callback. | ||
| 2085 | + * callback is only invoked when an invalid header name/value pair is | ||
| 2086 | + * received which is silently ignored if neither this callback nor | ||
| 2087 | + * :type:`nghttp2_on_invalid_header_callback` is set. Only invalid | ||
| 2088 | + * regular header field are passed to this callback. In other words, | ||
| 2089 | + * invalid pseudo header field is not passed to this callback. Also | ||
| 2090 | + * header fields which includes upper cased latter are also treated as | ||
| 2091 | + * error without passing them to this callback. | ||
| 2090 | 2092 | * | |
| 2091 | 2093 | * This callback is only considered if HTTP messaging validation is | |
| 2092 | 2094 | * turned on (which is on by default, see | |
@@ -2445,6 +2447,15 @@ typedef int (*nghttp2_error_callback2)(nghttp2_session *session, | |||
| 2445 | 2447 | int lib_error_code, const char *msg, | |
| 2446 | 2448 | size_t len, void *user_data); | |
| 2447 | 2449 | ||
| 2450 | + /** | ||
| 2451 | + * @functypedef | ||
| 2452 | + * | ||
| 2453 | + * Callback function invoked when unpredictable data of |destlen| | ||
| 2454 | + * bytes are needed. The implementation must write unpredictable data | ||
| 2455 | + * of |destlen| bytes into the buffer pointed by |dest|. | ||
| 2456 | + */ | ||
| 2457 | + typedef void (*nghttp2_rand_callback)(uint8_t *dest, size_t destlen); | ||
| 2458 | + | ||
| 2448 | 2459 | struct nghttp2_session_callbacks; | |
| 2449 | 2460 | ||
| 2450 | 2461 | /** | |
@@ -2649,7 +2660,7 @@ NGHTTP2_EXTERN void nghttp2_session_callbacks_set_on_header_callback2( | |||
| 2649 | 2660 | /** | |
| 2650 | 2661 | * @function | |
| 2651 | 2662 | * | |
| 2652 | - * Sets callback function invoked when a invalid header name/value | ||
| 2663 | + * Sets callback function invoked when an invalid header name/value | ||
| 2653 | 2664 | * pair is received. If both | |
| 2654 | 2665 | * `nghttp2_session_callbacks_set_on_invalid_header_callback()` and | |
| 2655 | 2666 | * `nghttp2_session_callbacks_set_on_invalid_header_callback2()` are | |
@@ -2662,7 +2673,7 @@ NGHTTP2_EXTERN void nghttp2_session_callbacks_set_on_invalid_header_callback( | |||
| 2662 | 2673 | /** | |
| 2663 | 2674 | * @function | |
| 2664 | 2675 | * | |
| 2665 | - * Sets callback function invoked when a invalid header name/value | ||
| 2676 | + * Sets callback function invoked when an invalid header name/value | ||
| 2666 | 2677 | * pair is received. | |
| 2667 | 2678 | */ | |
| 2668 | 2679 | NGHTTP2_EXTERN void nghttp2_session_callbacks_set_on_invalid_header_callback2( | |
@@ -2833,6 +2844,18 @@ NGHTTP2_EXTERN void nghttp2_session_callbacks_set_error_callback( | |||
| 2833 | 2844 | NGHTTP2_EXTERN void nghttp2_session_callbacks_set_error_callback2( | |
| 2834 | 2845 | nghttp2_session_callbacks *cbs, nghttp2_error_callback2 error_callback2); | |
| 2835 | 2846 | ||
| 2847 | + /** | ||
| 2848 | + * @function | ||
| 2849 | + * | ||
| 2850 | + * Sets callback function invoked when unpredictable data is needed. | ||
| 2851 | + * Although this callback is optional due to the backward | ||
| 2852 | + * compatibility, it is recommended to specify it to harden the | ||
| 2853 | + * runtime behavior against suspicious activities of a remote | ||
| 2854 | + * endpoint. | ||
| 2855 | + */ | ||
| 2856 | + NGHTTP2_EXTERN void nghttp2_session_callbacks_set_rand_callback( | ||
| 2857 | + nghttp2_session_callbacks *cbs, nghttp2_rand_callback rand_callback); | ||
| 2858 | + | ||
| 2836 | 2859 | /** | |
| 2837 | 2860 | * @functypedef | |
| 2838 | 2861 | * | |
@@ -3218,6 +3241,23 @@ nghttp2_option_set_stream_reset_rate_limit(nghttp2_option *option, | |||
| 3218 | 3241 | NGHTTP2_EXTERN void nghttp2_option_set_max_continuations(nghttp2_option *option, | |
| 3219 | 3242 | size_t val); | |
| 3220 | 3243 | ||
| 3244 | + /** | ||
| 3245 | + * @function | ||
| 3246 | + * | ||
| 3247 | + * This function sets the rate limit for the "glitches", the | ||
| 3248 | + * suspicious activities from a remote endpoint. It is a token-bucket | ||
| 3249 | + * based rate limiter. |burst| specifies the number of tokens that is | ||
| 3250 | + * initially available. The maximum number of tokens is capped to | ||
| 3251 | + * this value. |rate| specifies the number of tokens that are | ||
| 3252 | + * regenerated per second. When a suspicious activity is detected, | ||
| 3253 | + * some amount of tokens are consumed. If there is no token | ||
| 3254 | + * available, GOAWAY is sent to tear down the connection. |burst| and | ||
| 3255 | + * |rate| default to 1000 and 33 respectively. | ||
| 3256 | + */ | ||
| 3257 | + NGHTTP2_EXTERN void nghttp2_option_set_glitch_rate_limit(nghttp2_option *option, | ||
| 3258 | + uint64_t burst, | ||
| 3259 | + uint64_t rate); | ||
| 3260 | + | ||
| 3221 | 3261 | /** | |
| 3222 | 3262 | * @function | |
| 3223 | 3263 | * | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -29,14 +29,14 @@ | |||
| 29 | 29 | * @macro | |
| 30 | 30 | * Version number of the nghttp2 library release | |
| 31 | 31 | */ | |
| 32 | - #define NGHTTP2_VERSION "1.66.0" | ||
| 32 | + #define NGHTTP2_VERSION "1.67.1" | ||
| 33 | 33 | ||
| 34 | 34 | /** | |
| 35 | 35 | * @macro | |
| 36 | 36 | * Numerical representation of the version number of the nghttp2 library | |
| 37 | 37 | * release. This is a 24 bit number with 8 bits for major number, 8 bits | |
| 38 | 38 | * for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203. | |
| 39 | 39 | */ | |
| 40 | - #define NGHTTP2_VERSION_NUM 0x014200 | ||
| 40 | + #define NGHTTP2_VERSION_NUM 0x014301 | ||
| 41 | 41 | ||
| 42 | 42 | #endif /* NGHTTP2VER_H */ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -201,3 +201,8 @@ void nghttp2_session_callbacks_set_error_callback2( | |||
| 201 | 201 | nghttp2_session_callbacks *cbs, nghttp2_error_callback2 error_callback2) { | |
| 202 | 202 | cbs->error_callback2 = error_callback2; | |
| 203 | 203 | } | |
| 204 | + | ||
| 205 | + void nghttp2_session_callbacks_set_rand_callback( | ||
| 206 | + nghttp2_session_callbacks *cbs, nghttp2_rand_callback rand_callback) { | ||
| 207 | + cbs->rand_callback = rand_callback; | ||
| 208 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -151,6 +151,7 @@ struct nghttp2_session_callbacks { | |||
| 151 | 151 | nghttp2_on_extension_chunk_recv_callback on_extension_chunk_recv_callback; | |
| 152 | 152 | nghttp2_error_callback error_callback; | |
| 153 | 153 | nghttp2_error_callback2 error_callback2; | |
| 154 | + nghttp2_rand_callback rand_callback; | ||
| 154 | 155 | }; | |
| 155 | 156 | ||
| 156 | 157 | #endif /* NGHTTP2_CALLBACKS_H */ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -52,7 +52,11 @@ typedef enum { | |||
| 52 | 52 | * Unlike NGHTTP2_ERR_IGN_HTTP_HEADER, this does not invoke | |
| 53 | 53 | * nghttp2_on_invalid_header_callback. | |
| 54 | 54 | */ | |
| 55 | - NGHTTP2_ERR_REMOVE_HTTP_HEADER = -106 | ||
| 55 | + NGHTTP2_ERR_REMOVE_HTTP_HEADER = -106, | ||
| 56 | + /* | ||
| 57 | + * Cancel pushed stream. | ||
| 58 | + */ | ||
| 59 | + NGHTTP2_ERR_PUSH_CANCEL = -107, | ||
| 56 | 60 | } nghttp2_internal_error; | |
| 57 | 61 | ||
| 58 | 62 | #endif /* NGHTTP2_INT_H */ | |
| Back | FazBrowse Home | New Git URL |
0 commit comments