From 1657a425c103cd78ecaff79a0b46600e0c7e8afc Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Tue, 7 Sep 2021 13:40:41 +0900 Subject: [PATCH] Build with the latest ngtcp2 --- src/h2load_quic.cc | 11 +---------- src/shrpx_quic_connection_handler.cc | 8 ++++---- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/src/h2load_quic.cc b/src/h2load_quic.cc index f9339f18..70610156 100644 --- a/src/h2load_quic.cc +++ b/src/h2load_quic.cc @@ -305,16 +305,7 @@ int Client::quic_init(const sockaddr *local_addr, socklen_t local_addrlen, SSL_set_quic_use_legacy_codepoint(ssl, 0); } - switch (remote_addr->sa_family) { - case AF_INET: - quic.max_pktlen = NGTCP2_MAX_PKTLEN_IPV4; - break; - case AF_INET6: - quic.max_pktlen = NGTCP2_MAX_PKTLEN_IPV6; - break; - default: - return -1; - } + quic.max_pktlen = NGTCP2_MAX_UDP_PAYLOAD_SIZE; auto callbacks = ngtcp2_callbacks{ ngtcp2_crypto_client_initial_cb, diff --git a/src/shrpx_quic_connection_handler.cc b/src/shrpx_quic_connection_handler.cc index afeaa30a..1d1fae40 100644 --- a/src/shrpx_quic_connection_handler.cc +++ b/src/shrpx_quic_connection_handler.cc @@ -372,7 +372,7 @@ int QUICConnectionHandler::send_retry( return -1; } - std::array buf; + std::array buf; auto nwrite = ngtcp2_crypto_write_retry(buf.data(), buf.size(), version, &iscid, @@ -396,7 +396,7 @@ int QUICConnectionHandler::send_version_negotiation( sv[0] = generate_reserved_version(remote_addr, version); sv[1] = NGTCP2_PROTO_VER_V1; - std::array buf; + std::array buf; uint8_t rand_byte; util::random_bytes(&rand_byte, &rand_byte + 1, worker_->get_randgen()); @@ -455,7 +455,7 @@ int QUICConnectionHandler::send_stateless_reset(const UpstreamAddr *faddr, return -1; } - std::array buf; + std::array buf; auto nwrite = ngtcp2_pkt_write_stateless_reset(buf.data(), buf.size(), token.data(), @@ -481,7 +481,7 @@ int QUICConnectionHandler::send_connection_close( const UpstreamAddr *faddr, uint32_t version, const ngtcp2_cid *ini_dcid, const ngtcp2_cid *ini_scid, const Address &remote_addr, const Address &local_addr, uint64_t error_code) { - std::array buf; + std::array buf; auto nwrite = ngtcp2_crypto_write_connection_close( buf.data(), buf.size(), version, ini_scid, ini_dcid, error_code);