nghttpx: Send stateless reset token in TP

This commit is contained in:
Tatsuhiro Tsujikawa 2021-08-17 22:18:18 +09:00
parent 93a44d4c4c
commit 739dd025a0
1 changed files with 11 additions and 0 deletions

View File

@ -477,6 +477,17 @@ int Http3Upstream::init(const UpstreamAddr *faddr, const Address &remote_addr,
static_cast<ngtcp2_tstamp>(quicconf.timeout.idle * NGTCP2_SECONDS); static_cast<ngtcp2_tstamp>(quicconf.timeout.idle * NGTCP2_SECONDS);
params.original_dcid = initial_hd.dcid; params.original_dcid = initial_hd.dcid;
auto &stateless_resetconf = quicconf.stateless_reset;
rv = generate_quic_stateless_reset_token(params.stateless_reset_token, &scid,
stateless_resetconf.secret.data(),
stateless_resetconf.secret.size());
if (rv != 0) {
LOG(ERROR) << "generate_quic_stateless_reset_token failed";
return -1;
}
params.stateless_reset_token_present = 1;
auto path = ngtcp2_path{ auto path = ngtcp2_path{
{local_addr.len, const_cast<sockaddr *>(&local_addr.su.sa)}, {local_addr.len, const_cast<sockaddr *>(&local_addr.su.sa)},
{remote_addr.len, const_cast<sockaddr *>(&remote_addr.su.sa)}, {remote_addr.len, const_cast<sockaddr *>(&remote_addr.su.sa)},