diff --git a/src/http3.cc b/src/http3.cc index 9d9185ea..61134ad7 100644 --- a/src/http3.cc +++ b/src/http3.cc @@ -201,15 +201,6 @@ int check_nv(const uint8_t *name, size_t namelen, const uint8_t *value, return 1; } -void dump_nv(FILE *out, const nghttp3_nv *nva, size_t nvlen) { - auto end = nva + nvlen; - for (; nva != end; ++nva) { - fprintf(out, "%s: %s\n", nva->name, nva->value); - } - fputc('\n', out); - fflush(out); -} - } // namespace http3 } // namespace nghttp2 diff --git a/src/http3.h b/src/http3.h index dfabd784..81ee0d73 100644 --- a/src/http3.h +++ b/src/http3.h @@ -110,18 +110,12 @@ void copy_headers_to_nva(std::vector &nva, void copy_headers_to_nva_nocopy(std::vector &nva, const HeaderRefs &headers, uint32_t flags); -// Dumps name/value pairs in |nva| to |out|. -void dump_nv(FILE *out, const nghttp3_nv *nva, size_t nvlen); - // Checks the header name/value pair using nghttp3_check_header_name() // and nghttp3_check_header_value(). If both function returns nonzero, // this function returns nonzero. int check_nv(const uint8_t *name, size_t namelen, const uint8_t *value, size_t valuelen); -// Dumps name/value pairs in |nva| to |out|. -void dump_nv(FILE *out, const nghttp3_nv *nva, size_t nvlen); - } // namespace http3 } // namespace nghttp2 diff --git a/src/shrpx_http3_upstream.cc b/src/shrpx_http3_upstream.cc index ae6b080b..08f1f6a7 100644 --- a/src/shrpx_http3_upstream.cc +++ b/src/shrpx_http3_upstream.cc @@ -1058,8 +1058,6 @@ int Http3Upstream::on_downstream_header_complete(Downstream *downstream) { } #endif // HAVE_MRUBY - auto &http2conf = config->http2; - auto nva = std::vector(); // 4 means :status and possible server, via, and set-cookie (for // affinity cookie) header field. @@ -1163,11 +1161,6 @@ int Http3Upstream::on_downstream_header_complete(Downstream *downstream) { log_response_headers(downstream, nva); } - if (http2conf.upstream.debug.dump.response_header) { - http3::dump_nv(http2conf.upstream.debug.dump.response_header, nva.data(), - nva.size()); - } - nghttp3_data_reader data_read; data_read.read_data = downstream_read_data_callback; @@ -1811,13 +1804,6 @@ int Http3Upstream::http_end_request_headers(Downstream *downstream) { << ss.str(); } - auto config = get_config(); - auto &dump = config->http2.upstream.debug.dump; - - if (dump.request_header) { - http2::dump_nv(dump.request_header, nva); - } - auto content_length = req.fs.header(http2::HD_CONTENT_LENGTH); if (content_length) { // libnghttp2 guarantees this can be parsed @@ -1840,6 +1826,8 @@ int Http3Upstream::http_end_request_headers(Downstream *downstream) { auto faddr = handler_->get_upstream_addr(); + auto config = get_config(); + // For HTTP/2 proxy, we require :authority. if (method_token != HTTP_CONNECT && config->http2_proxy && faddr->alt_mode == UpstreamAltMode::NONE && !authority) {