From 2afad0c65022a2e9527db42beb9eba5a3ba80a3b Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 4 Sep 2021 17:43:24 +0900 Subject: [PATCH] nghttpx: Use ngtcp2_conn_get_client_initial_dcid --- src/shrpx_http3_upstream.cc | 7 +++---- src/shrpx_http3_upstream.h | 1 - 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/shrpx_http3_upstream.cc b/src/shrpx_http3_upstream.cc index f15961b7..c43d3e1f 100644 --- a/src/shrpx_http3_upstream.cc +++ b/src/shrpx_http3_upstream.cc @@ -149,7 +149,8 @@ Http3Upstream::~Http3Upstream() { auto worker = handler_->get_worker(); auto quic_client_handler = worker->get_quic_connection_handler(); - quic_client_handler->remove_connection_id(&initial_client_dcid_); + quic_client_handler->remove_connection_id( + ngtcp2_conn_get_client_initial_dcid(conn_)); std::vector scids(ngtcp2_conn_get_num_scid(conn_)); ngtcp2_conn_get_scid(conn_, scids.data()); @@ -516,8 +517,6 @@ int Http3Upstream::init(const UpstreamAddr *faddr, const Address &remote_addr, shrpx::stream_stop_sending, }; - initial_client_dcid_ = initial_hd.dcid; - ngtcp2_cid scid; if (generate_quic_connection_id(&scid, SHRPX_QUIC_SCIDLEN, @@ -592,7 +591,7 @@ int Http3Upstream::init(const UpstreamAddr *faddr, const Address &remote_addr, auto quic_connection_handler = worker->get_quic_connection_handler(); - quic_connection_handler->add_connection_id(&initial_client_dcid_, handler_); + quic_connection_handler->add_connection_id(&initial_hd.dcid, handler_); quic_connection_handler->add_connection_id(&scid, handler_); return 0; diff --git a/src/shrpx_http3_upstream.h b/src/shrpx_http3_upstream.h index fcc3d122..c5ca2a27 100644 --- a/src/shrpx_http3_upstream.h +++ b/src/shrpx_http3_upstream.h @@ -154,7 +154,6 @@ private: ev_timer idle_timer_; ev_timer shutdown_timer_; ev_prepare prep_; - ngtcp2_cid initial_client_dcid_; ngtcp2_conn *conn_; quic::Error last_error_; uint8_t tls_alert_;