Skip to content

Commit 9acc7f3

Browse files
jasnellMylesBorins
authored andcommitted
deps: update nghttp2 to 1.29.0
Backport-PR-URL: #20456 PR-URL: #17908 Refs: #17746 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
1 parent a1539e5 commit 9acc7f3

15 files changed

+128
-45
lines changed

deps/nghttp2/lib/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ set_target_properties(nghttp2 PROPERTIES
4444
VERSION ${LT_VERSION} SOVERSION ${LT_SOVERSION}
4545
C_VISIBILITY_PRESET hidden
4646
)
47+
target_include_directories(nghttp2 INTERFACE
48+
"${CMAKE_CURRENT_BINARY_DIR}/includes"
49+
"${CMAKE_CURRENT_SOURCE_DIR}/includes"
50+
)
4751

4852
if(HAVE_CUNIT)
4953
# Static library (for unittests because of symbol visibility)

deps/nghttp2/lib/includes/nghttp2/nghttp2.h

Lines changed: 59 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,11 @@ typedef enum {
387387
* Indicates that a processing was canceled.
388388
*/
389389
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,
390395
/**
391396
* The errors < :enum:`NGHTTP2_ERR_FATAL` mean that the library is
392397
* under unexpected condition and processing was terminated (e.g.,
@@ -1987,6 +1992,9 @@ typedef ssize_t (*nghttp2_pack_extension_callback)(nghttp2_session *session,
19871992
* of length |len|. |len| does not include the sentinel NULL
19881993
* character.
19891994
*
1995+
* This function is deprecated. The new application should use
1996+
* :type:`nghttp2_error_callback2`.
1997+
*
19901998
* The format of error message may change between nghttp2 library
19911999
* versions. The application should not depend on the particular
19922000
* format.
@@ -2003,6 +2011,33 @@ typedef ssize_t (*nghttp2_pack_extension_callback)(nghttp2_session *session,
20032011
typedef int (*nghttp2_error_callback)(nghttp2_session *session, const char *msg,
20042012
size_t len, void *user_data);
20052013

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+
20062041
struct nghttp2_session_callbacks;
20072042

20082043
/**
@@ -2267,10 +2302,30 @@ nghttp2_session_callbacks_set_on_extension_chunk_recv_callback(
22672302
*
22682303
* Sets callback function invoked when library tells error message to
22692304
* 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.
22702312
*/
22712313
NGHTTP2_EXTERN void nghttp2_session_callbacks_set_error_callback(
22722314
nghttp2_session_callbacks *cbs, nghttp2_error_callback error_callback);
22732315

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+
22742329
/**
22752330
* @functypedef
22762331
*
@@ -4702,8 +4757,8 @@ nghttp2_hd_deflate_change_table_size(nghttp2_hd_deflater *deflater,
47024757
*
47034758
* After this function returns, it is safe to delete the |nva|.
47044759
*
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:
47074762
*
47084763
* :enum:`NGHTTP2_ERR_NOMEM`
47094764
* Out of memory.
@@ -4734,8 +4789,8 @@ NGHTTP2_EXTERN ssize_t nghttp2_hd_deflate_hd(nghttp2_hd_deflater *deflater,
47344789
*
47354790
* After this function returns, it is safe to delete the |nva|.
47364791
*
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:
47394794
*
47404795
* :enum:`NGHTTP2_ERR_NOMEM`
47414796
* Out of memory.

deps/nghttp2/lib/includes/nghttp2/nghttp2ver.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@
2929
* @macro
3030
* Version number of the nghttp2 library release
3131
*/
32-
#define NGHTTP2_VERSION "1.25.0"
32+
#define NGHTTP2_VERSION "1.29.0"
3333

3434
/**
3535
* @macro
3636
* Numerical representation of the version number of the nghttp2 library
3737
* release. This is a 24 bit number with 8 bits for major number, 8 bits
3838
* for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203.
3939
*/
40-
#define NGHTTP2_VERSION_NUM 0x011900
40+
#define NGHTTP2_VERSION_NUM 0x011d00
4141

4242
#endif /* NGHTTP2VER_H */

deps/nghttp2/lib/nghttp2_buf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ int nghttp2_bufs_advance(nghttp2_bufs *bufs);
398398
void nghttp2_bufs_seek_last_present(nghttp2_bufs *bufs);
399399

400400
/*
401-
* Returns nonzero if bufs->cur->next is not emtpy.
401+
* Returns nonzero if bufs->cur->next is not empty.
402402
*/
403403
int nghttp2_bufs_next_present(nghttp2_bufs *bufs);
404404

deps/nghttp2/lib/nghttp2_callbacks.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,3 +168,8 @@ void nghttp2_session_callbacks_set_error_callback(
168168
nghttp2_session_callbacks *cbs, nghttp2_error_callback error_callback) {
169169
cbs->error_callback = error_callback;
170170
}
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+
}

deps/nghttp2/lib/nghttp2_callbacks.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ struct nghttp2_session_callbacks {
119119
nghttp2_unpack_extension_callback unpack_extension_callback;
120120
nghttp2_on_extension_chunk_recv_callback on_extension_chunk_recv_callback;
121121
nghttp2_error_callback error_callback;
122+
nghttp2_error_callback2 error_callback2;
122123
};
123124

124125
#endif /* NGHTTP2_CALLBACKS_H */

deps/nghttp2/lib/nghttp2_frame.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@
7070
#define NGHTTP2_MAX_PADLEN 256
7171

7272
/* 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;
7476

7577
void nghttp2_frame_pack_frame_hd(uint8_t *buf, const nghttp2_frame_hd *hd);
7678

deps/nghttp2/lib/nghttp2_hd.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,9 @@ typedef struct {
211211

212212
#define HD_MAP_SIZE 128
213213

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;
215217

216218
struct nghttp2_hd_deflater {
217219
nghttp2_hd_context ctx;
@@ -313,7 +315,7 @@ void nghttp2_hd_deflate_free(nghttp2_hd_deflater *deflater);
313315
*
314316
* This function expands |bufs| as necessary to store the result. If
315317
* 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.
317319
*
318320
* After this function returns, it is safe to delete the |nva|.
319321
*

deps/nghttp2/lib/nghttp2_helper.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,9 @@ const char *nghttp2_strerror(int error_code) {
322322
return "Internal error";
323323
case NGHTTP2_ERR_CANCEL:
324324
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";
325328
case NGHTTP2_ERR_NOMEM:
326329
return "Out of memory";
327330
case NGHTTP2_ERR_CALLBACK_FAILURE:

deps/nghttp2/lib/nghttp2_outbound_item.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ struct nghttp2_outbound_item {
112112
nghttp2_ext_frame_payload ext_frame_payload;
113113
nghttp2_aux_data aux_data;
114114
/* 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
116116
response HEADERS frame) have dedicated cycle value defined above.
117117
For DATA frame, cycle is computed by taking into account of
118118
effective weight and frame payload length previously sent, so

0 commit comments

Comments
 (0)