Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
ab150d7
test: remove flakiness on macOS test
anonrig Feb 9, 2025
0a82d27
test: reduce flakiness on test-net-write-fully-async-buffer
anonrig Feb 9, 2025
d0ee8c0
src: improve error handling in process_wrap
jasnell Feb 11, 2025
41f444f
src: improve error handling in string_bytes/decoder
jasnell Feb 11, 2025
d8e70dc
src: improve node::Dotenv trimming
dario-piotrowicz Feb 11, 2025
9b98ac6
test: update WPT for urlpattern to ef6d83d789
nodejs-github-bot Feb 12, 2025
2990cc8
doc: run license-builder
github-actions[bot] Feb 12, 2025
35f89aa
build: fix GN build of uv
zcbenz Feb 12, 2025
3bc6d62
doc: add `signal` to `filehandle.writeFile()` options
y-hsgw Feb 12, 2025
7e2dac9
src: add self-assigment memcpy checks
wooffie Feb 12, 2025
a6b7bce
doc: move stability index after history section for consistency
aduh95 Feb 12, 2025
a9112df
tools: add support for `import source` syntax in linter
aduh95 Feb 12, 2025
c011271
doc: update cleanup to trust on vuln db automation
RafaelGSS Feb 13, 2025
18ea88b
crypto: cleanup root certificates and skip PEM deserialization
joyeecheung Feb 13, 2025
2ec4ff1
meta: update last name for jkrems
hybrist Feb 13, 2025
dfdaa92
crypto: fix missing OPENSSL_NO_ENGINE guard
codebytere Feb 14, 2025
1efd74b
tools: fix release URL computation in update-root-certs.mjs
joyeecheung Feb 14, 2025
44dd8a5
doc: buffer: fix typo on `Buffer.copyBytesFrom(` `offset` option
tpoisseau Feb 14, 2025
6951133
doc: improve documentation on argument validation
Aditi-1400 Feb 14, 2025
b369ad6
test: remove unnecessary assert requiring from tests
dario-piotrowicz Feb 14, 2025
ccb8c12
test,crypto: make tests work for BoringSSL
codebytere Feb 15, 2025
5af35d1
build: fix GN build failure
zcbenz Feb 15, 2025
50ba04e
doc: recommend writing tests in new files and including comments
joyeecheung Feb 15, 2025
6cdee54
tools: do not run major-release workflow on forks
Trott Feb 15, 2025
a588066
test: add case for unrecognised fields within pjson "exports"
JakobJingleheimer Feb 13, 2025
40f3a51
fs: handle UV_ENOTDIR in `fs.statSync` with `throwIfNoEntry` provided
juanarbol Feb 10, 2025
5b2dfad
doc: add a note about `require('../common')` in testing documentation
Aditi-1400 Feb 15, 2025
b50fc42
crypto: support --use-system-ca on non-Windows and non-macOS
joyeecheung Feb 15, 2025
fa26f83
src: lock the isolate properly in IsolateData destructor
joyeecheung Feb 15, 2025
286bb84
src: fix accessing empty string
zcbenz Feb 16, 2025
c02494f
doc: fix transpiler loader hooks documentation
joyeecheung Feb 16, 2025
a7e5ef9
doc: fix wrong verb form
dario-piotrowicz Feb 16, 2025
9de45cb
doc: `modules.md`: fix `distance` definition
alexweej Feb 16, 2025
f4a82fd
benchmark: add a warmup on bench-openSync
elvessilvavieira Feb 16, 2025
ed5671f
doc: update `module.builtinModules` sentence
dario-piotrowicz Feb 16, 2025
78d4e52
doc: fix wrong articles used to address modules
dario-piotrowicz Feb 17, 2025
4b02fdc
doc: update Xcode version used for arm64 and pkg
targos Feb 17, 2025
5414eb4
src: improve error handling in multiple files
jasnell Feb 8, 2025
90875ba
src: improve error handling in node_blob
jasnell Feb 15, 2025
46df14d
doc: update clang-cl on Windows building guide
joyeecheung Feb 18, 2025
fec2d50
build: add skip_apidoc_files and include QUIC
RafaelGSS Feb 6, 2025
ac35106
sea: suppress builtin warning with disableExperimentalSEAWarning option
koooge Feb 16, 2025
5a74568
doc: disambiguate pseudo-code statement
dario-piotrowicz Feb 18, 2025
cc1cafd
module: allow omitting context in synchronous next hooks
joyeecheung Feb 18, 2025
21d795a
dns: add TLSA record query and parsing
rithvikvibhu May 14, 2024
0de128c
doc: add `module namespace object` links
dario-piotrowicz Feb 16, 2025
b696049
doc: fix link and history of `SourceMap` sections
aduh95 Feb 18, 2025
56f9fe7
src: port `defineLazyProperties` to native code
aduh95 Feb 18, 2025
e3127b8
src: replace NewFromUtf8 with OneByteString where appropriate
jasnell Feb 18, 2025
2929fc6
test_runner: allow special characters in snapshot keys
Ceres6 Feb 19, 2025
b384baa
build: print 'Formatting Markdown...' for long task markdown formatting
1ilsang Feb 19, 2025
e26d484
cli: allow --cpu-prof* in NODE_OPTIONS
Ceres6 Feb 20, 2025
73a8514
tools: consolidate 'introduced_in' check for docs
1ilsang Feb 20, 2025
fdc8aeb
doc: fix 'introduced_in' version in typescript module
1ilsang Feb 20, 2025
7dd326e
src: move instead of copy shared pointer in node_blob
targos Feb 20, 2025
e0a91f6
src: gate all quic behind disabled-by-default compile flag
jasnell Feb 19, 2025
d62299b
meta: add CODEOWNERS for SQLite
cjihrig Feb 20, 2025
90a4de0
src: do not format single string argument for THROW_ERR_*
joyeecheung Feb 18, 2025
ad3c572
module: improve error message from asynchronicity in require(esm)
joyeecheung Feb 17, 2025
8421021
deps: update ada to 3.1.0
nodejs-github-bot Feb 20, 2025
ccf496c
test: improve error output of test-http2-client-promisify-connect-error
aduh95 Feb 21, 2025
c6ddfa5
process: add threadCpuUsage
ShogunPanda Feb 21, 2025
d922153
url: improve urlpattern regexp performance
anonrig Feb 21, 2025
c6d6be2
typings: fix `ImportModuleDynamicallyCallback` return type
legendecas Feb 21, 2025
315244e
test: simplify test-http2-client-promisify-connect-error
lpinca Feb 22, 2025
587112c
doc: remove buffered flag from performance hooks examples
pavel-romanov8 Feb 23, 2025
85ac02f
meta: bump `github/codeql-action` from 3.27.5 to 3.28.8
dependabot[bot] Feb 23, 2025
7f5f02b
meta: bump `actions/stale` from 9.0.0 to 9.1.0
dependabot[bot] Feb 23, 2025
dfd42db
meta: bump `actions/cache` from 4.1.2 to 4.2.0
dependabot[bot] Feb 23, 2025
58d7036
meta: bump `step-security/harden-runner` from 2.10.2 to 2.10.4
dependabot[bot] Feb 23, 2025
0dd0108
meta: bump `codecov/codecov-action` from 5.0.7 to 5.3.1
dependabot[bot] Feb 23, 2025
3d61604
meta: bump `mozilla-actions/sccache-action` from 0.0.6 to 0.0.7
dependabot[bot] Feb 23, 2025
35cdd9b
meta: bump `peter-evans/create-pull-request` from 7.0.5 to 7.0.6
dependabot[bot] Feb 23, 2025
f77069b
meta: bump `actions/setup-python` from 5.3.0 to 5.4.0
dependabot[bot] Feb 23, 2025
d6234b4
inspector: skip promise hook in the inspector async hook
joyeecheung Feb 23, 2025
a025d7b
tools: run Linux tests on GitHub arm64 runners as well
dennisameling Feb 23, 2025
ef314dc
src: fix crash when lazy getter is invoked in a vm context
legendecas Feb 23, 2025
66614cf
doc: fix web.libera.chat link in pull-requests.md
SamB Feb 23, 2025
7c7e9f4
test: make eval snapshot comparison more flexible
codebytere Feb 23, 2025
51dff8b
test: fix test-without-async-context-frame.mjs in debug mode
joyeecheung Feb 15, 2025
116c1fe
test_runner: refactor testPlan counter increse
pmarchini Feb 23, 2025
4413ce7
doc: fix typo in Windows building instructions
timja Feb 24, 2025
e10ef27
inspector: convert event params to protocol without json
legendecas Feb 24, 2025
f35bd86
doc: add additional caveat for fs.watch
mhdawson Feb 24, 2025
1a24417
test: add doAppendAndCancel test
y-hsgw Feb 24, 2025
455bf5a
doc: update options to filehandle.appendFile()
y-hsgw Feb 24, 2025
e08d7d4
lib: fixup incorrect argument order in assertEncoding
jasnell Feb 22, 2025
aa81785
lib: fixup more incorrect ERR_INVALID_ARG_VALUE uses
jasnell Feb 23, 2025
2aceca1
deps: update sqlite to 3.49.1
nodejs-github-bot Feb 25, 2025
8644cf3
deps: update ngtcp2 to 1.11.0
nodejs-github-bot Feb 25, 2025
8076284
deps: update cjs-module-lexer to 2.1.0
nodejs-github-bot Feb 25, 2025
9d2368f
2025-02-26, Version 23.9.0 (Current)
nodejs-github-bot Feb 25, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
deps: update ngtcp2 to 1.11.0
PR-URL: #57179
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
  • Loading branch information
nodejs-github-bot authored and targos committed Feb 25, 2025
commit 8644cf3e5a212c3d2511eab9acc8f5828414de54
4 changes: 2 additions & 2 deletions deps/ngtcp2/ngtcp2/crypto/includes/ngtcp2/ngtcp2_crypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ ngtcp2_crypto_hp_mask_cb(uint8_t *dest, const ngtcp2_crypto_cipher *hp,
* :enum:`ngtcp2_encryption_level.NGTCP2_ENCRYPTION_LEVEL_0RTT`) to
* set negotiated AEAD and message digest algorithm. After the
* successful call of this function, application can use
* `ngtcp2_conn_get_crypto_ctx` (or `ngtcp2_conn_get_early_crypto_ctx`
* `ngtcp2_conn_get_crypto_ctx` (or `ngtcp2_conn_get_0rtt_crypto_ctx`
* if |level| ==
* :enum:`ngtcp2_encryption_level.NGTCP2_ENCRYPTION_LEVEL_0RTT`) to
* get :type:`ngtcp2_crypto_ctx`.
Expand Down Expand Up @@ -378,7 +378,7 @@ NGTCP2_EXTERN int ngtcp2_crypto_derive_and_install_rx_key(
* :enum:`ngtcp2_encryption_level.NGTCP2_ENCRYPTION_LEVEL_0RTT`) to
* set negotiated AEAD and message digest algorithm. After the
* successful call of this function, application can use
* `ngtcp2_conn_get_crypto_ctx` (or `ngtcp2_conn_get_early_crypto_ctx`
* `ngtcp2_conn_get_crypto_ctx` (or `ngtcp2_conn_get_0rtt_crypto_ctx`
* if |level| ==
* :enum:`ngtcp2_encryption_level.NGTCP2_ENCRYPTION_LEVEL_0RTT`) to
* get :type:`ngtcp2_crypto_ctx`.
Expand Down
47 changes: 25 additions & 22 deletions deps/ngtcp2/ngtcp2/crypto/picotls/picotls.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ static int supported_cipher_suite(ptls_cipher_suite_t *cs) {
#ifdef PTLS_OPENSSL_HAVE_CHACHA20_POLY1305
|| cs->aead == &ptls_openssl_chacha20poly1305
#endif /* defined(PTLS_OPENSSL_HAVE_CHACHA20_POLY1305) */
;
;
}

ngtcp2_crypto_ctx *ngtcp2_crypto_ctx_tls(ngtcp2_crypto_ctx *ctx,
Expand All @@ -146,7 +146,7 @@ ngtcp2_crypto_ctx *ngtcp2_crypto_ctx_tls(ngtcp2_crypto_ctx *ctx,
ctx->hp.native_handle = (void *)crypto_cipher_suite_get_hp(cs);
ctx->max_encryption = crypto_cipher_suite_get_aead_max_encryption(cs);
ctx->max_decryption_failure =
crypto_cipher_suite_get_aead_max_decryption_failure(cs);
crypto_cipher_suite_get_aead_max_decryption_failure(cs);
return ctx;
}

Expand Down Expand Up @@ -329,19 +329,22 @@ int ngtcp2_crypto_decrypt(uint8_t *dest, const ngtcp2_crypto_aead *aead,
const uint8_t *nonce, size_t noncelen,
const uint8_t *aad, size_t aadlen) {
ptls_aead_context_t *actx = aead_ctx->native_handle;
size_t nwrite;

(void)aead;

ptls_aead_xor_iv(actx, nonce, noncelen);

if (ptls_aead_decrypt(actx, dest, ciphertext, ciphertextlen, 0, aad,
aadlen) == SIZE_MAX) {
return -1;
}
nwrite =
ptls_aead_decrypt(actx, dest, ciphertext, ciphertextlen, 0, aad, aadlen);

/* zero-out static iv once again */
ptls_aead_xor_iv(actx, nonce, noncelen);

if (nwrite == SIZE_MAX) {
return -1;
}

return 0;
}

Expand All @@ -360,13 +363,13 @@ int ngtcp2_crypto_hp_mask(uint8_t *dest, const ngtcp2_crypto_cipher *hp,
}

int ngtcp2_crypto_read_write_crypto_data(
ngtcp2_conn *conn, ngtcp2_encryption_level encryption_level,
const uint8_t *data, size_t datalen) {
ngtcp2_conn *conn, ngtcp2_encryption_level encryption_level,
const uint8_t *data, size_t datalen) {
ngtcp2_crypto_picotls_ctx *cptls = ngtcp2_conn_get_tls_native_handle(conn);
ptls_buffer_t sendbuf;
size_t epoch_offsets[5] = {0};
size_t epoch =
ngtcp2_crypto_picotls_from_ngtcp2_encryption_level(encryption_level);
ngtcp2_crypto_picotls_from_ngtcp2_encryption_level(encryption_level);
size_t epoch_datalen;
size_t i;
int rv;
Expand All @@ -388,7 +391,7 @@ int ngtcp2_crypto_read_write_crypto_data(

if (!ngtcp2_conn_is_server(conn) &&
cptls->handshake_properties.client.early_data_acceptance ==
PTLS_EARLY_DATA_REJECTED) {
PTLS_EARLY_DATA_REJECTED) {
rv = ngtcp2_conn_tls_early_data_rejected(conn);
if (rv != 0) {
rv = -1;
Expand All @@ -405,8 +408,8 @@ int ngtcp2_crypto_read_write_crypto_data(
assert(i != 1);

if (ngtcp2_conn_submit_crypto_data(
conn, ngtcp2_crypto_picotls_from_epoch(i),
sendbuf.base + epoch_offsets[i], epoch_datalen) != 0) {
conn, ngtcp2_crypto_picotls_from_epoch(i),
sendbuf.base + epoch_offsets[i], epoch_datalen) != 0) {
rv = -1;
goto fin;
}
Expand Down Expand Up @@ -463,7 +466,7 @@ ngtcp2_encryption_level ngtcp2_crypto_picotls_from_epoch(size_t epoch) {
}

size_t ngtcp2_crypto_picotls_from_ngtcp2_encryption_level(
ngtcp2_encryption_level encryption_level) {
ngtcp2_encryption_level encryption_level) {
switch (encryption_level) {
case NGTCP2_ENCRYPTION_LEVEL_INITIAL:
return 0;
Expand Down Expand Up @@ -532,17 +535,17 @@ static int set_additional_extensions(ptls_handshake_properties_t *hsprops,
}

int ngtcp2_crypto_picotls_collect_extension(
ptls_t *ptls, struct st_ptls_handshake_properties_t *properties,
uint16_t type) {
ptls_t *ptls, struct st_ptls_handshake_properties_t *properties,
uint16_t type) {
(void)ptls;
(void)properties;

return type == NGTCP2_TLSEXT_QUIC_TRANSPORT_PARAMETERS_V1;
}

int ngtcp2_crypto_picotls_collected_extensions(
ptls_t *ptls, struct st_ptls_handshake_properties_t *properties,
ptls_raw_extension_t *extensions) {
ptls_t *ptls, struct st_ptls_handshake_properties_t *properties,
ptls_raw_extension_t *extensions) {
ngtcp2_crypto_conn_ref *conn_ref;
ngtcp2_conn *conn;
int rv;
Expand All @@ -558,7 +561,7 @@ int ngtcp2_crypto_picotls_collected_extensions(
conn = conn_ref->get_conn(conn_ref);

rv = ngtcp2_conn_decode_and_set_remote_transport_params(
conn, extensions->data.base, extensions->data.len);
conn, extensions->data.base, extensions->data.len);
if (rv != 0) {
ngtcp2_conn_set_tls_error(conn, rv);
return -1;
Expand Down Expand Up @@ -613,7 +616,7 @@ static int update_traffic_key_server_cb(ptls_update_traffic_key_t *self,
}

static ptls_update_traffic_key_t update_traffic_key_server = {
update_traffic_key_server_cb,
update_traffic_key_server_cb,
};

static int update_traffic_key_cb(ptls_update_traffic_key_t *self, ptls_t *ptls,
Expand Down Expand Up @@ -661,7 +664,7 @@ int ngtcp2_crypto_picotls_configure_client_context(ptls_context_t *ctx) {
}

int ngtcp2_crypto_picotls_configure_server_session(
ngtcp2_crypto_picotls_ctx *cptls) {
ngtcp2_crypto_picotls_ctx *cptls) {
ptls_handshake_properties_t *hsprops = &cptls->handshake_properties;

hsprops->collect_extension = ngtcp2_crypto_picotls_collect_extension;
Expand All @@ -671,7 +674,7 @@ int ngtcp2_crypto_picotls_configure_server_session(
}

int ngtcp2_crypto_picotls_configure_client_session(
ngtcp2_crypto_picotls_ctx *cptls, ngtcp2_conn *conn) {
ngtcp2_crypto_picotls_ctx *cptls, ngtcp2_conn *conn) {
ptls_handshake_properties_t *hsprops = &cptls->handshake_properties;

hsprops->client.max_early_data_size = calloc(1, sizeof(size_t));
Expand All @@ -692,7 +695,7 @@ int ngtcp2_crypto_picotls_configure_client_session(
}

void ngtcp2_crypto_picotls_deconfigure_session(
ngtcp2_crypto_picotls_ctx *cptls) {
ngtcp2_crypto_picotls_ctx *cptls) {
ptls_handshake_properties_t *hsprops;
ptls_raw_extension_t *exts;

Expand Down
8 changes: 6 additions & 2 deletions deps/ngtcp2/ngtcp2/lib/includes/ngtcp2/ngtcp2.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,12 @@ typedef void *(*ngtcp2_realloc)(void *ptr, size_t size, void *user_data);
* }
*
* void conn_new() {
* ngtcp2_mem mem = {NULL, my_malloc_cb, my_free_cb, my_calloc_cb,
* my_realloc_cb};
* ngtcp2_mem mem = {
* .malloc = my_malloc_cb,
* .free = my_free_cb,
* .calloc = my_calloc_cb,
* .realloc = my_realloc_cb,
* };
*
* ...
* }
Expand Down
4 changes: 2 additions & 2 deletions deps/ngtcp2/ngtcp2/lib/includes/ngtcp2/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
*
* Version number of the ngtcp2 library release.
*/
#define NGTCP2_VERSION "1.10.0"
#define NGTCP2_VERSION "1.11.0"

/**
* @macro
Expand All @@ -46,6 +46,6 @@
* number, 8 bits for minor and 8 bits for patch. Version 1.2.3
* becomes 0x010203.
*/
#define NGTCP2_VERSION_NUM 0x010a00
#define NGTCP2_VERSION_NUM 0x010b00

#endif /* !defined(NGTCP2_VERSION_H) */
114 changes: 114 additions & 0 deletions deps/ngtcp2/ngtcp2/lib/ngtcp2_acktr.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "ngtcp2_acktr.h"

#include <assert.h>
#include <string.h>

#include "ngtcp2_macro.h"
#include "ngtcp2_tstamp.h"
Expand Down Expand Up @@ -70,6 +71,9 @@ void ngtcp2_acktr_init(ngtcp2_acktr *acktr, ngtcp2_log *log,
acktr->flags = NGTCP2_ACKTR_FLAG_NONE;
acktr->first_unacked_ts = UINT64_MAX;
acktr->rx_npkt = 0;
acktr->max_pkt_num = -1;
acktr->max_pkt_ts = UINT64_MAX;
memset(&acktr->ecn, 0, sizeof(acktr->ecn));
}

void ngtcp2_acktr_free(ngtcp2_acktr *acktr) {
Expand Down Expand Up @@ -180,6 +184,11 @@ int ngtcp2_acktr_add(ngtcp2_acktr *acktr, int64_t pkt_num, int active_ack,
ngtcp2_acktr_entry_objalloc_del(delent, &acktr->objalloc);
}

if (acktr->max_pkt_num < pkt_num) {
acktr->max_pkt_num = pkt_num;
acktr->max_pkt_ts = ts;
}

return 0;
}

Expand Down Expand Up @@ -323,3 +332,108 @@ int ngtcp2_acktr_require_active_ack(const ngtcp2_acktr *acktr,
void ngtcp2_acktr_immediate_ack(ngtcp2_acktr *acktr) {
acktr->flags |= NGTCP2_ACKTR_FLAG_IMMEDIATE_ACK;
}

ngtcp2_frame *ngtcp2_acktr_create_ack_frame(ngtcp2_acktr *acktr,
ngtcp2_frame *fr, uint8_t type,
ngtcp2_tstamp ts,
ngtcp2_duration ack_delay,
uint64_t ack_delay_exponent) {
int64_t last_pkt_num;
ngtcp2_ack_range *range;
ngtcp2_ksl_it it;
ngtcp2_acktr_entry *rpkt;
ngtcp2_ack *ack = &fr->ack;
ngtcp2_tstamp largest_ack_ts;
size_t num_acks;

if (acktr->flags & NGTCP2_ACKTR_FLAG_IMMEDIATE_ACK) {
ack_delay = 0;
}

if (!ngtcp2_acktr_require_active_ack(acktr, ack_delay, ts)) {
return NULL;
}

it = ngtcp2_acktr_get(acktr);
if (ngtcp2_ksl_it_end(&it)) {
ngtcp2_acktr_commit_ack(acktr);
return NULL;
}

num_acks = ngtcp2_ksl_len(&acktr->ents);

if (acktr->ecn.ect0 || acktr->ecn.ect1 || acktr->ecn.ce) {
ack->type = NGTCP2_FRAME_ACK_ECN;
ack->ecn.ect0 = acktr->ecn.ect0;
ack->ecn.ect1 = acktr->ecn.ect1;
ack->ecn.ce = acktr->ecn.ce;
} else {
ack->type = NGTCP2_FRAME_ACK;
}
ack->rangecnt = 0;

rpkt = ngtcp2_ksl_it_get(&it);

if (rpkt->pkt_num == acktr->max_pkt_num) {
last_pkt_num = rpkt->pkt_num - (int64_t)(rpkt->len - 1);
largest_ack_ts = rpkt->tstamp;
ack->largest_ack = rpkt->pkt_num;
ack->first_ack_range = rpkt->len - 1;

ngtcp2_ksl_it_next(&it);
--num_acks;
} else if (rpkt->pkt_num + 1 == acktr->max_pkt_num) {
last_pkt_num = rpkt->pkt_num - (int64_t)(rpkt->len - 1);
largest_ack_ts = acktr->max_pkt_ts;
ack->largest_ack = acktr->max_pkt_num;
ack->first_ack_range = rpkt->len;

ngtcp2_ksl_it_next(&it);
--num_acks;
} else {
assert(rpkt->pkt_num < acktr->max_pkt_num);

last_pkt_num = acktr->max_pkt_num;
largest_ack_ts = acktr->max_pkt_ts;
ack->largest_ack = acktr->max_pkt_num;
ack->first_ack_range = 0;
}

if (type == NGTCP2_PKT_1RTT) {
ack->ack_delay_unscaled = ts - largest_ack_ts;
ack->ack_delay = ack->ack_delay_unscaled / NGTCP2_MICROSECONDS /
(1ULL << ack_delay_exponent);
} else {
ack->ack_delay_unscaled = 0;
ack->ack_delay = 0;
}

num_acks = ngtcp2_min_size(num_acks, NGTCP2_MAX_ACK_RANGES);

for (; ack->rangecnt < num_acks; ngtcp2_ksl_it_next(&it)) {
rpkt = ngtcp2_ksl_it_get(&it);

range = &ack->ranges[ack->rangecnt++];
range->gap = (uint64_t)(last_pkt_num - rpkt->pkt_num - 2);
range->len = rpkt->len - 1;

last_pkt_num = rpkt->pkt_num - (int64_t)(rpkt->len - 1);
}

return fr;
}

void ngtcp2_acktr_increase_ecn_counts(ngtcp2_acktr *acktr,
const ngtcp2_pkt_info *pi) {
switch (pi->ecn & NGTCP2_ECN_MASK) {
case NGTCP2_ECN_ECT_0:
++acktr->ecn.ect0;
break;
case NGTCP2_ECN_ECT_1:
++acktr->ecn.ect1;
break;
case NGTCP2_ECN_CE:
++acktr->ecn.ce;
break;
}
}
Loading