From bed00fb8e19f093ae26d595d48d4d22b7540752d Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 27 Aug 2021 18:20:17 +0900 Subject: [PATCH] nghttpx: Use buf.size() --- src/shrpx_http3_upstream.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/shrpx_http3_upstream.cc b/src/shrpx_http3_upstream.cc index 0287f591..ae6b080b 100644 --- a/src/shrpx_http3_upstream.cc +++ b/src/shrpx_http3_upstream.cc @@ -1538,8 +1538,7 @@ int Http3Upstream::handle_error() { if (last_error_.type == quic::ErrorType::Transport) { nwrite = ngtcp2_conn_write_connection_close( - conn_, &ps.path, &pi, buf.data(), SHRPX_MAX_UDP_PAYLOAD_SIZE, - last_error_.code, ts); + conn_, &ps.path, &pi, buf.data(), buf.size(), last_error_.code, ts); if (nwrite < 0) { LOG(ERROR) << "ngtcp2_conn_write_connection_close: " << ngtcp2_strerror(nwrite); @@ -1547,8 +1546,7 @@ int Http3Upstream::handle_error() { } } else { nwrite = ngtcp2_conn_write_application_close( - conn_, &ps.path, &pi, buf.data(), SHRPX_MAX_UDP_PAYLOAD_SIZE, - last_error_.code, ts); + conn_, &ps.path, &pi, buf.data(), buf.size(), last_error_.code, ts); if (nwrite < 0) { LOG(ERROR) << "ngtcp2_conn_write_application_close: " << ngtcp2_strerror(nwrite);