nghttpx: Do not dump HTTP/3 header fields

This commit is contained in:
Tatsuhiro Tsujikawa 2021-08-27 18:35:27 +09:00
parent 717e7ae8b2
commit c1bcf0f11a
3 changed files with 2 additions and 29 deletions

View File

@ -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

View File

@ -110,18 +110,12 @@ void copy_headers_to_nva(std::vector<nghttp3_nv> &nva,
void copy_headers_to_nva_nocopy(std::vector<nghttp3_nv> &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

View File

@ -1058,8 +1058,6 @@ int Http3Upstream::on_downstream_header_complete(Downstream *downstream) {
}
#endif // HAVE_MRUBY
auto &http2conf = config->http2;
auto nva = std::vector<nghttp3_nv>();
// 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) {