Skip to content

Commit c609565

Browse files
deps: update ngtcp2 to 1.21.0
1 parent 6964b53 commit c609565

File tree

15 files changed

+229
-223
lines changed

15 files changed

+229
-223
lines changed

deps/ngtcp2/ngtcp2/examples/client.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,17 +1049,16 @@ ngtcp2_ssize write_pkt(ngtcp2_conn *conn, ngtcp2_path *path,
10491049
ngtcp2_ssize Client::write_pkt(ngtcp2_path *path, ngtcp2_pkt_info *pi,
10501050
uint8_t *dest, size_t destlen,
10511051
ngtcp2_tstamp ts) {
1052-
std::array<SharedVec, 16> vec;
1052+
std::array<nghttp3_vec, 16> vec;
10531053

10541054
for (;;) {
10551055
int64_t stream_id = -1;
10561056
int fin = 0;
10571057
nghttp3_ssize sveccnt = 0;
10581058

10591059
if (httpconn_ && ngtcp2_conn_get_max_data_left(conn_)) {
1060-
sveccnt = nghttp3_conn_writev_stream(
1061-
httpconn_, &stream_id, &fin,
1062-
reinterpret_cast<nghttp3_vec *>(vec.data()), vec.size());
1060+
sveccnt = nghttp3_conn_writev_stream(httpconn_, &stream_id, &fin,
1061+
vec.data(), vec.size());
10631062
if (sveccnt < 0) {
10641063
std::cerr << "nghttp3_conn_writev_stream: "
10651064
<< nghttp3_strerror(static_cast<int>(sveccnt)) << std::endl;
@@ -1072,6 +1071,7 @@ ngtcp2_ssize Client::write_pkt(ngtcp2_path *path, ngtcp2_pkt_info *pi,
10721071
}
10731072

10741073
ngtcp2_ssize ndatalen;
1074+
auto v = vec.data();
10751075
auto vcnt = static_cast<size_t>(sveccnt);
10761076

10771077
uint32_t flags = NGTCP2_WRITE_STREAM_FLAG_MORE;
@@ -1081,7 +1081,7 @@ ngtcp2_ssize Client::write_pkt(ngtcp2_path *path, ngtcp2_pkt_info *pi,
10811081

10821082
auto nwrite = ngtcp2_conn_writev_stream(
10831083
conn_, path, pi, dest, destlen, &ndatalen, flags, stream_id,
1084-
reinterpret_cast<const ngtcp2_vec *>(vec.data()), vcnt, ts);
1084+
reinterpret_cast<const ngtcp2_vec *>(v), vcnt, ts);
10851085
if (nwrite < 0) {
10861086
switch (nwrite) {
10871087
case NGTCP2_ERR_STREAM_DATA_BLOCKED:

deps/ngtcp2/ngtcp2/examples/server.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1652,17 +1652,16 @@ ngtcp2_ssize write_pkt(ngtcp2_conn *conn, ngtcp2_path *path,
16521652
ngtcp2_ssize Handler::write_pkt(ngtcp2_path *path, ngtcp2_pkt_info *pi,
16531653
uint8_t *dest, size_t destlen,
16541654
ngtcp2_tstamp ts) {
1655-
std::array<SharedVec, 16> vec;
1655+
std::array<nghttp3_vec, 16> vec;
16561656

16571657
for (;;) {
16581658
int64_t stream_id = -1;
16591659
int fin = 0;
16601660
nghttp3_ssize sveccnt = 0;
16611661

16621662
if (httpconn_ && ngtcp2_conn_get_max_data_left(conn_)) {
1663-
sveccnt = nghttp3_conn_writev_stream(
1664-
httpconn_, &stream_id, &fin,
1665-
reinterpret_cast<nghttp3_vec *>(vec.data()), vec.size());
1663+
sveccnt = nghttp3_conn_writev_stream(httpconn_, &stream_id, &fin,
1664+
vec.data(), vec.size());
16661665
if (sveccnt < 0) {
16671666
std::cerr << "nghttp3_conn_writev_stream: "
16681667
<< nghttp3_strerror(static_cast<int>(sveccnt)) << std::endl;
@@ -1675,6 +1674,7 @@ ngtcp2_ssize Handler::write_pkt(ngtcp2_path *path, ngtcp2_pkt_info *pi,
16751674
}
16761675

16771676
ngtcp2_ssize ndatalen;
1677+
auto v = vec.data();
16781678
auto vcnt = static_cast<size_t>(sveccnt);
16791679

16801680
uint32_t flags =
@@ -1685,7 +1685,7 @@ ngtcp2_ssize Handler::write_pkt(ngtcp2_path *path, ngtcp2_pkt_info *pi,
16851685

16861686
auto nwrite = ngtcp2_conn_writev_stream(
16871687
conn_, path, pi, dest, destlen, &ndatalen, flags, stream_id,
1688-
reinterpret_cast<const ngtcp2_vec *>(vec.data()), vcnt, ts);
1688+
reinterpret_cast<const ngtcp2_vec *>(v), vcnt, ts);
16891689
if (nwrite < 0) {
16901690
switch (nwrite) {
16911691
case NGTCP2_ERR_STREAM_DATA_BLOCKED:

deps/ngtcp2/ngtcp2/examples/shared.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
#include <span>
3535

3636
#include <ngtcp2/ngtcp2.h>
37-
#include <nghttp3/nghttp3.h>
3837

3938
#include "network.h"
4039

@@ -64,11 +63,6 @@ inline constexpr uint32_t TLS_ALERT_ECH_REQUIRED = 121;
6463

6564
inline constexpr size_t MAX_RECV_PKTS = 64;
6665

67-
union SharedVec {
68-
ngtcp2_vec v2;
69-
nghttp3_vec v3;
70-
};
71-
7266
// msghdr_get_ecn gets ECN bits from |msg|. |family| is the address
7367
// family from which packet is received.
7468
uint8_t msghdr_get_ecn(msghdr *msg, int family);

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,7 +1281,7 @@ typedef struct ngtcp2_sockaddr_in {
12811281
} ngtcp2_sockaddr_in;
12821282

12831283
typedef struct ngtcp2_in6_addr {
1284-
uint8_t in6_addr[16];
1284+
uint8_t s6_addr[16];
12851285
} ngtcp2_in6_addr;
12861286

12871287
typedef struct ngtcp2_sockaddr_in6 {
@@ -1866,8 +1866,8 @@ typedef struct ngtcp2_settings {
18661866
uint64_t max_stream_window;
18671867
/**
18681868
* :member:`ack_thresh` is the minimum number of the received ACK
1869-
* eliciting packets that trigger the immediate acknowledgement from
1870-
* the local endpoint.
1869+
* eliciting packets that triggers the immediate acknowledgement
1870+
* from the local endpoint.
18711871
*/
18721872
size_t ack_thresh;
18731873
/**

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
*
3737
* Version number of the ngtcp2 library release.
3838
*/
39-
#define NGTCP2_VERSION "1.20.0"
39+
#define NGTCP2_VERSION "1.21.0"
4040

4141
/**
4242
* @macro
@@ -46,6 +46,6 @@
4646
* number, 8 bits for minor and 8 bits for patch. Version 1.2.3
4747
* becomes 0x010203.
4848
*/
49-
#define NGTCP2_VERSION_NUM 0x011400
49+
#define NGTCP2_VERSION_NUM 0x011500
5050

5151
#endif /* !defined(NGTCP2_VERSION_H) */

0 commit comments

Comments
 (0)