deps: update nghttp3 to 1.17.0 · nodejs/node@e3304cd · GitHub
Skip to content

Commit e3304cd

Browse files
nodejs-github-botaduh95
authored andcommitted
deps: update nghttp3 to 1.17.0
PR-URL: #64182 Backport-PR-URL: #64675 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Tim Perry <pimterry@gmail.com>
1 parent 345d6ad commit e3304cd

13 files changed

Lines changed: 4351 additions & 4265 deletions

deps/ngtcp2/nghttp3/lib/includes/nghttp3/nghttp3.h

Lines changed: 88 additions & 0 deletions

deps/ngtcp2/nghttp3/lib/includes/nghttp3/version.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
*
3232
* Version number of the nghttp3 library release.
3333
*/
34-
#define NGHTTP3_VERSION "1.16.0"
34+
#define NGHTTP3_VERSION "1.17.0"
3535

3636
/**
3737
* @macro
@@ -41,6 +41,6 @@
4141
* number, 8 bits for minor and 8 bits for patch. Version 1.2.3
4242
* becomes 0x010203.
4343
*/
44-
#define NGHTTP3_VERSION_NUM 0x011000
44+
#define NGHTTP3_VERSION_NUM 0x011100
4545

4646
#endif /* !defined(NGHTTP3_VERSION_H) */

deps/ngtcp2/nghttp3/lib/nghttp3_conn.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2979,3 +2979,25 @@ int nghttp3_conn_is_drained2(const nghttp3_conn *conn) {
29792979
nghttp3_stream_outq_write_done(conn->tx.ctrl) &&
29802980
nghttp3_ringbuf_len(&conn->tx.ctrl->frq) == 0;
29812981
}
2982+
2983+
int nghttp3_conn_is_stream_flushed(const nghttp3_conn *conn,
2984+
int64_t stream_id) {
2985+
nghttp3_stream *stream = nghttp3_conn_find_stream(conn, stream_id);
2986+
const nghttp3_frame *fr;
2987+
2988+
if (!stream) {
2989+
return 1;
2990+
}
2991+
2992+
if (!nghttp3_stream_outq_write_done(stream)) {
2993+
return 0;
2994+
}
2995+
2996+
if (nghttp3_ringbuf_len(&stream->frq) == 0) {
2997+
return 1;
2998+
}
2999+
3000+
fr = nghttp3_ringbuf_get(&stream->frq, 0);
3001+
3002+
return fr->hd.type == NGHTTP3_FRAME_DATA;
3003+
}

deps/ngtcp2/nghttp3/lib/nghttp3_conv.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,15 @@ size_t nghttp3_get_uvarintlen(const uint8_t *p) {
7070
return (size_t)(1U << (*p >> 6));
7171
}
7272

73+
const uint8_t *nghttp3_get_varint(int64_t *dest, const uint8_t *p) {
74+
uint64_t n;
75+
76+
p = nghttp3_get_uvarint(&n, p);
77+
*dest = (int64_t)n;
78+
79+
return p;
80+
}
81+
7382
uint8_t *nghttp3_put_uint64be(uint8_t *p, uint64_t n) {
7483
n = nghttp3_htonl64(n);
7584
return nghttp3_cpymem(p, (const uint8_t *)&n, sizeof(n));

deps/ngtcp2/nghttp3/lib/nghttp3_conv.h

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -92,34 +92,6 @@
9292
# define ntohs(N) _byteswap_ushort(N)
9393
#endif /* defined(WIN32) */
9494

95-
/*
96-
* nghttp3_get_uvarint reads variable-length unsigned integer from
97-
* |p|, and stores it in the buffer pointed by |dest| in host byte
98-
* order. It returns |p| plus the number of bytes read from |p|.
99-
*/
100-
const uint8_t *nghttp3_get_uvarint(uint64_t *dest, const uint8_t *p);
101-
102-
/*
103-
* nghttp3_get_uvarintlen returns the required number of bytes to read
104-
* variable-length integer starting at |p|.
105-
*/
106-
size_t nghttp3_get_uvarintlen(const uint8_t *p);
107-
108-
/*
109-
* nghttp3_get_varint reads variable-length unsigned integer from |p|,
110-
* and stores it in the buffer pointed by |dest| in host byte order.
111-
* It returns |p| plus the number of bytes read from |p|.
112-
*/
113-
static inline const uint8_t *nghttp3_get_varint(int64_t *dest,
114-
const uint8_t *p) {
115-
uint64_t n;
116-
117-
p = nghttp3_get_uvarint(&n, p);
118-
*dest = (int64_t)n;
119-
120-
return p;
121-
}
122-
12395
/*
12496
* nghttp3_put_uint64be writes |n| in host byte order in |p| in
12597
* network byte order. It returns the one beyond of the last written
@@ -141,18 +113,6 @@ uint8_t *nghttp3_put_uint32be(uint8_t *p, uint32_t n);
141113
*/
142114
uint8_t *nghttp3_put_uint16be(uint8_t *p, uint16_t n);
143115

144-
/*
145-
* nghttp3_put_uvarint writes |n| in |p| using variable-length integer
146-
* encoding. It returns the one beyond of the last written position.
147-
*/
148-
uint8_t *nghttp3_put_uvarint(uint8_t *p, uint64_t n);
149-
150-
/*
151-
* nghttp3_put_uvarintlen returns the required number of bytes to
152-
* encode |n|.
153-
*/
154-
size_t nghttp3_put_uvarintlen(uint64_t n);
155-
156116
/*
157117
* nghttp3_ord_stream_id returns the ordinal number of |stream_id|.
158118
*/

deps/ngtcp2/nghttp3/lib/nghttp3_http.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,9 @@
3636
#include "nghttp3_macro.h"
3737
#include "nghttp3_conv.h"
3838
#include "nghttp3_unreachable.h"
39+
#include "nghttp3_str.h"
3940
#include "sfparse/sfparse.h"
4041

41-
static uint8_t downcase(uint8_t c) {
42-
return 'A' <= c && c <= 'Z' ? (uint8_t)(c - 'A' + 'a') : c;
43-
}
44-
4542
/*
4643
* memieq returns 1 if the data pointed by |a| of length |n| equals to
4744
* |b| of the same length in case-insensitive manner. The data
@@ -52,7 +49,7 @@ static int memieq(const void *a, const void *b, size_t n) {
5249
const uint8_t *aa = a, *bb = b;
5350

5451
for (i = 0; i < n; ++i) {
55-
if (aa[i] != downcase(bb[i])) {
52+
if (aa[i] != nghttp3_downcase_byte(bb[i])) {
5653
return 0;
5754
}
5855
}
@@ -704,7 +701,7 @@ int nghttp3_check_header_name(const uint8_t *name, size_t len) {
704701
--len;
705702
}
706703
for (last = name + len; name != last; ++name) {
707-
if (!VALID_HD_NAME_CHARS[*name]) {
704+
if (VALID_HD_NAME_CHARS[*name] != 1) {
708705
return 0;
709706
}
710707
}

deps/ngtcp2/nghttp3/lib/nghttp3_qpack_huffman.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ uint8_t *nghttp3_qpack_huffman_encode(uint8_t *dest, const uint8_t *src,
8080
void nghttp3_qpack_huffman_decode_context_init(
8181
nghttp3_qpack_huffman_decode_context *ctx) {
8282
*ctx = (nghttp3_qpack_huffman_decode_context){
83-
.flags = NGHTTP3_QPACK_HUFFMAN_ACCEPTED,
83+
.flags = NGHTTP3_QPACK_HUFFMAN_FLAG_ACCEPTED,
8484
};
8585
}
8686

@@ -103,20 +103,20 @@ nghttp3_qpack_huffman_decode(nghttp3_qpack_huffman_decode_context *ctx,
103103
for (; src != end;) {
104104
c = *src++;
105105
t = qpack_huffman_decode_table[t.fstate][c >> 4];
106-
if (t.flags & NGHTTP3_QPACK_HUFFMAN_SYM) {
106+
if (t.flags & NGHTTP3_QPACK_HUFFMAN_FLAG_SYM) {
107107
*p++ = t.sym;
108108
}
109109

110110
t = qpack_huffman_decode_table[t.fstate][c & 0xFU];
111-
if (t.flags & NGHTTP3_QPACK_HUFFMAN_SYM) {
111+
if (t.flags & NGHTTP3_QPACK_HUFFMAN_FLAG_SYM) {
112112
*p++ = t.sym;
113113
}
114114
}
115115

116116
ctx->fstate = t.fstate;
117117
ctx->flags = t.flags;
118118

119-
if (fin && !(ctx->flags & NGHTTP3_QPACK_HUFFMAN_ACCEPTED)) {
119+
if (fin && !(ctx->flags & NGHTTP3_QPACK_HUFFMAN_FLAG_ACCEPTED)) {
120120
return NGHTTP3_ERR_QPACK_FATAL;
121121
}
122122

deps/ngtcp2/nghttp3/lib/nghttp3_qpack_huffman.h

Lines changed: 12 additions & 13 deletions

0 commit comments

Comments
 (0)