| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent a1539e5 commit 9acc7f3
15 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -44,6 +44,10 @@ set_target_properties(nghttp2 PROPERTIES | |||
| 44 | 44 | VERSION ${LT_VERSION} SOVERSION ${LT_SOVERSION} | |
| 45 | 45 | C_VISIBILITY_PRESET hidden | |
| 46 | 46 | ) | |
| 47 | + target_include_directories(nghttp2 INTERFACE | ||
| 48 | + "${CMAKE_CURRENT_BINARY_DIR}/includes" | ||
| 49 | + "${CMAKE_CURRENT_SOURCE_DIR}/includes" | ||
| 50 | + ) | ||
| 47 | 51 | ||
| 48 | 52 | if(HAVE_CUNIT) | |
| 49 | 53 | # Static library (for unittests because of symbol visibility) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -387,6 +387,11 @@ typedef enum { | |||
| 387 | 387 | * Indicates that a processing was canceled. | |
| 388 | 388 | */ | |
| 389 | 389 | NGHTTP2_ERR_CANCEL = -535, | |
| 390 | + /** | ||
| 391 | + * When a local endpoint expects to receive SETTINGS frame, it | ||
| 392 | + * receives an other type of frame. | ||
| 393 | + */ | ||
| 394 | + NGHTTP2_ERR_SETTINGS_EXPECTED = -536, | ||
| 390 | 395 | /** | |
| 391 | 396 | * The errors < :enum:`NGHTTP2_ERR_FATAL` mean that the library is | |
| 392 | 397 | * under unexpected condition and processing was terminated (e.g., | |
@@ -1987,6 +1992,9 @@ typedef ssize_t (*nghttp2_pack_extension_callback)(nghttp2_session *session, | |||
| 1987 | 1992 | * of length |len|. |len| does not include the sentinel NULL | |
| 1988 | 1993 | * character. | |
| 1989 | 1994 | * | |
| 1995 | + * This function is deprecated. The new application should use | ||
| 1996 | + * :type:`nghttp2_error_callback2`. | ||
| 1997 | + * | ||
| 1990 | 1998 | * The format of error message may change between nghttp2 library | |
| 1991 | 1999 | * versions. The application should not depend on the particular | |
| 1992 | 2000 | * format. | |
@@ -2003,6 +2011,33 @@ typedef ssize_t (*nghttp2_pack_extension_callback)(nghttp2_session *session, | |||
| 2003 | 2011 | typedef int (*nghttp2_error_callback)(nghttp2_session *session, const char *msg, | |
| 2004 | 2012 | size_t len, void *user_data); | |
| 2005 | 2013 | ||
| 2014 | + /** | ||
| 2015 | + * @functypedef | ||
| 2016 | + * | ||
| 2017 | + * Callback function invoked when library provides the error code, and | ||
| 2018 | + * message. This callback is solely for debugging purpose. | ||
| 2019 | + * |lib_error_code| is one of error code defined in | ||
| 2020 | + * :enum:`nghttp2_error`. The |msg| is typically NULL-terminated | ||
| 2021 | + * string of length |len|, and intended for human consumption. |len| | ||
| 2022 | + * does not include the sentinel NULL character. | ||
| 2023 | + * | ||
| 2024 | + * The format of error message may change between nghttp2 library | ||
| 2025 | + * versions. The application should not depend on the particular | ||
| 2026 | + * format. | ||
| 2027 | + * | ||
| 2028 | + * Normally, application should return 0 from this callback. If fatal | ||
| 2029 | + * error occurred while doing something in this callback, application | ||
| 2030 | + * should return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. In this case, | ||
| 2031 | + * library will return immediately with return value | ||
| 2032 | + * :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. Currently, if nonzero value | ||
| 2033 | + * is returned from this callback, they are treated as | ||
| 2034 | + * :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`, but application should not | ||
| 2035 | + * rely on this details. | ||
| 2036 | + */ | ||
| 2037 | + typedef int (*nghttp2_error_callback2)(nghttp2_session *session, | ||
| 2038 | + int lib_error_code, const char *msg, | ||
| 2039 | + size_t len, void *user_data); | ||
| 2040 | + | ||
| 2006 | 2041 | struct nghttp2_session_callbacks; | |
| 2007 | 2042 | ||
| 2008 | 2043 | /** | |
@@ -2267,10 +2302,30 @@ nghttp2_session_callbacks_set_on_extension_chunk_recv_callback( | |||
| 2267 | 2302 | * | |
| 2268 | 2303 | * Sets callback function invoked when library tells error message to | |
| 2269 | 2304 | * the application. | |
| 2305 | + * | ||
| 2306 | + * This function is deprecated. The new application should use | ||
| 2307 | + * `nghttp2_session_callbacks_set_error_callback2()`. | ||
| 2308 | + * | ||
| 2309 | + * If both :type:`nghttp2_error_callback` and | ||
| 2310 | + * :type:`nghttp2_error_callback2` are set, the latter takes | ||
| 2311 | + * precedence. | ||
| 2270 | 2312 | */ | |
| 2271 | 2313 | NGHTTP2_EXTERN void nghttp2_session_callbacks_set_error_callback( | |
| 2272 | 2314 | nghttp2_session_callbacks *cbs, nghttp2_error_callback error_callback); | |
| 2273 | 2315 | ||
| 2316 | + /** | ||
| 2317 | + * @function | ||
| 2318 | + * | ||
| 2319 | + * Sets callback function invoked when library tells error code, and | ||
| 2320 | + * message to the application. | ||
| 2321 | + * | ||
| 2322 | + * If both :type:`nghttp2_error_callback` and | ||
| 2323 | + * :type:`nghttp2_error_callback2` are set, the latter takes | ||
| 2324 | + * precedence. | ||
| 2325 | + */ | ||
| 2326 | + NGHTTP2_EXTERN void nghttp2_session_callbacks_set_error_callback2( | ||
| 2327 | + nghttp2_session_callbacks *cbs, nghttp2_error_callback2 error_callback2); | ||
| 2328 | + | ||
| 2274 | 2329 | /** | |
| 2275 | 2330 | * @functypedef | |
| 2276 | 2331 | * | |
@@ -4702,8 +4757,8 @@ nghttp2_hd_deflate_change_table_size(nghttp2_hd_deflater *deflater, | |||
| 4702 | 4757 | * | |
| 4703 | 4758 | * After this function returns, it is safe to delete the |nva|. | |
| 4704 | 4759 | * | |
| 4705 | - * This function returns 0 if it succeeds, or one of the following | ||
| 4706 | - * negative error codes: | ||
| 4760 | + * This function returns the number of bytes written to |buf| if it | ||
| 4761 | + * succeeds, or one of the following negative error codes: | ||
| 4707 | 4762 | * | |
| 4708 | 4763 | * :enum:`NGHTTP2_ERR_NOMEM` | |
| 4709 | 4764 | * Out of memory. | |
@@ -4734,8 +4789,8 @@ NGHTTP2_EXTERN ssize_t nghttp2_hd_deflate_hd(nghttp2_hd_deflater *deflater, | |||
| 4734 | 4789 | * | |
| 4735 | 4790 | * After this function returns, it is safe to delete the |nva|. | |
| 4736 | 4791 | * | |
| 4737 | - * This function returns 0 if it succeeds, or one of the following | ||
| 4738 | - * negative error codes: | ||
| 4792 | + * This function returns the number of bytes written to |vec| if it | ||
| 4793 | + * succeeds, or one of the following negative error codes: | ||
| 4739 | 4794 | * | |
| 4740 | 4795 | * :enum:`NGHTTP2_ERR_NOMEM` | |
| 4741 | 4796 | * Out of memory. | |
| 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.25.0" | ||
| 32 | + #define NGHTTP2_VERSION "1.29.0" | ||
| 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 0x011900 | ||
| 40 | + #define NGHTTP2_VERSION_NUM 0x011d00 | ||
| 41 | 41 | ||
| 42 | 42 | #endif /* NGHTTP2VER_H */ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -398,7 +398,7 @@ int nghttp2_bufs_advance(nghttp2_bufs *bufs); | |||
| 398 | 398 | void nghttp2_bufs_seek_last_present(nghttp2_bufs *bufs); | |
| 399 | 399 | ||
| 400 | 400 | /* | |
| 401 | - * Returns nonzero if bufs->cur->next is not emtpy. | ||
| 401 | + * Returns nonzero if bufs->cur->next is not empty. | ||
| 402 | 402 | */ | |
| 403 | 403 | int nghttp2_bufs_next_present(nghttp2_bufs *bufs); | |
| 404 | 404 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -168,3 +168,8 @@ void nghttp2_session_callbacks_set_error_callback( | |||
| 168 | 168 | nghttp2_session_callbacks *cbs, nghttp2_error_callback error_callback) { | |
| 169 | 169 | cbs->error_callback = error_callback; | |
| 170 | 170 | } | |
| 171 | + | ||
| 172 | + void nghttp2_session_callbacks_set_error_callback2( | ||
| 173 | + nghttp2_session_callbacks *cbs, nghttp2_error_callback2 error_callback2) { | ||
| 174 | + cbs->error_callback2 = error_callback2; | ||
| 175 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -119,6 +119,7 @@ struct nghttp2_session_callbacks { | |||
| 119 | 119 | nghttp2_unpack_extension_callback unpack_extension_callback; | |
| 120 | 120 | nghttp2_on_extension_chunk_recv_callback on_extension_chunk_recv_callback; | |
| 121 | 121 | nghttp2_error_callback error_callback; | |
| 122 | + nghttp2_error_callback2 error_callback2; | ||
| 122 | 123 | }; | |
| 123 | 124 | ||
| 124 | 125 | #endif /* NGHTTP2_CALLBACKS_H */ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -70,7 +70,9 @@ | |||
| 70 | 70 | #define NGHTTP2_MAX_PADLEN 256 | |
| 71 | 71 | ||
| 72 | 72 | /* Union of extension frame payload */ | |
| 73 | - typedef union { nghttp2_ext_altsvc altsvc; } nghttp2_ext_frame_payload; | ||
| 73 | + typedef union { | ||
| 74 | + nghttp2_ext_altsvc altsvc; | ||
| 75 | + } nghttp2_ext_frame_payload; | ||
| 74 | 76 | ||
| 75 | 77 | void nghttp2_frame_pack_frame_hd(uint8_t *buf, const nghttp2_frame_hd *hd); | |
| 76 | 78 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -211,7 +211,9 @@ typedef struct { | |||
| 211 | 211 | ||
| 212 | 212 | #define HD_MAP_SIZE 128 | |
| 213 | 213 | ||
| 214 | - typedef struct { nghttp2_hd_entry *table[HD_MAP_SIZE]; } nghttp2_hd_map; | ||
| 214 | + typedef struct { | ||
| 215 | + nghttp2_hd_entry *table[HD_MAP_SIZE]; | ||
| 216 | + } nghttp2_hd_map; | ||
| 215 | 217 | ||
| 216 | 218 | struct nghttp2_hd_deflater { | |
| 217 | 219 | nghttp2_hd_context ctx; | |
@@ -313,7 +315,7 @@ void nghttp2_hd_deflate_free(nghttp2_hd_deflater *deflater); | |||
| 313 | 315 | * | |
| 314 | 316 | * This function expands |bufs| as necessary to store the result. If | |
| 315 | 317 | * buffers is full and the process still requires more space, this | |
| 316 | - * funtion fails and returns NGHTTP2_ERR_HEADER_COMP. | ||
| 318 | + * function fails and returns NGHTTP2_ERR_HEADER_COMP. | ||
| 317 | 319 | * | |
| 318 | 320 | * After this function returns, it is safe to delete the |nva|. | |
| 319 | 321 | * | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -322,6 +322,9 @@ const char *nghttp2_strerror(int error_code) { | |||
| 322 | 322 | return "Internal error"; | |
| 323 | 323 | case NGHTTP2_ERR_CANCEL: | |
| 324 | 324 | return "Cancel"; | |
| 325 | + case NGHTTP2_ERR_SETTINGS_EXPECTED: | ||
| 326 | + return "When a local endpoint expects to receive SETTINGS frame, it " | ||
| 327 | + "receives an other type of frame"; | ||
| 325 | 328 | case NGHTTP2_ERR_NOMEM: | |
| 326 | 329 | return "Out of memory"; | |
| 327 | 330 | case NGHTTP2_ERR_CALLBACK_FAILURE: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -112,7 +112,7 @@ struct nghttp2_outbound_item { | |||
| 112 | 112 | nghttp2_ext_frame_payload ext_frame_payload; | |
| 113 | 113 | nghttp2_aux_data aux_data; | |
| 114 | 114 | /* The priority used in priority comparion. Smaller is served | |
| 115 | - ealier. For PING, SETTINGS and non-DATA frames (excluding | ||
| 115 | + earlier. For PING, SETTINGS and non-DATA frames (excluding | ||
| 116 | 116 | response HEADERS frame) have dedicated cycle value defined above. | |
| 117 | 117 | For DATA frame, cycle is computed by taking into account of | |
| 118 | 118 | effective weight and frame payload length previously sent, so | |
| Back | FazBrowse Home | New Git URL |
0 commit comments