nghttpx: Add --frontend-quic-debug-log option

This commit is contained in:
Tatsuhiro Tsujikawa 2021-08-27 19:16:25 +09:00
parent c9b11e9fbf
commit 5aeae7444f
4 changed files with 23 additions and 0 deletions

View File

@ -182,6 +182,7 @@ OPTIONS = [
"http2-altsvc",
"frontend-http3-read-timeout",
"frontend-quic-idle-timeout",
"frontend-quic-debug-log",
]
LOGVARS = [

View File

@ -2892,6 +2892,8 @@ QUIC:
Specify an idle timeout for QUIC connection.
Default: )"
<< config->quic.upstream.timeout.idle << R"(
--frontend-quic-debug-log
Output QUIC debug log to /dev/stderr.
--bpf-program-file=<PATH>
Specify a path to eBPF program file reuseport_kern.o to
direct an incoming QUIC UDP datagram to a correct
@ -3609,6 +3611,7 @@ int main(int argc, char **argv) {
&flag, 172},
{SHRPX_OPT_FRONTEND_QUIC_IDLE_TIMEOUT.c_str(), required_argument, &flag,
173},
{SHRPX_OPT_FRONTEND_QUIC_DEBUG_LOG.c_str(), no_argument, &flag, 174},
{nullptr, 0, nullptr, 0}};
int option_index = 0;
@ -4434,6 +4437,11 @@ int main(int argc, char **argv) {
cmdcfgs.emplace_back(SHRPX_OPT_FRONTEND_QUIC_IDLE_TIMEOUT,
StringRef{optarg});
break;
case 174:
// --frontend-quic-debug-log
cmdcfgs.emplace_back(SHRPX_OPT_FRONTEND_QUIC_DEBUG_LOG,
StringRef::from_lit("yes"));
break;
default:
break;
}

View File

@ -2275,6 +2275,11 @@ int option_lookup_token(const char *name, size_t namelen) {
return SHRPX_OPTID_PRIVATE_KEY_PASSWD_FILE;
}
break;
case 'g':
if (util::strieq_l("frontend-quic-debug-lo", name, 22)) {
return SHRPX_OPTID_FRONTEND_QUIC_DEBUG_LOG;
}
break;
case 'r':
if (util::strieq_l("backend-response-buffe", name, 22)) {
return SHRPX_OPTID_BACKEND_RESPONSE_BUFFER;
@ -3892,6 +3897,12 @@ int parse_config(Config *config, int optid, const StringRef &opt,
#else // !ENABLE_HTTP3
return 0;
#endif // !ENABLE_HTTP3
case SHRPX_OPTID_FRONTEND_QUIC_DEBUG_LOG:
#ifdef ENABLE_HTTP3
config->quic.upstream.debug.log = util::strieq_l("yes", optarg);
#endif // ENABLE_HTTP3
return 0;
case SHRPX_OPTID_CONF:
LOG(WARN) << "conf: ignored";

View File

@ -371,6 +371,8 @@ constexpr auto SHRPX_OPT_FRONTEND_HTTP3_READ_TIMEOUT =
StringRef::from_lit("frontend-http3-read-timeout");
constexpr auto SHRPX_OPT_FRONTEND_QUIC_IDLE_TIMEOUT =
StringRef::from_lit("frontend-quic-idle-timeout");
constexpr auto SHRPX_OPT_FRONTEND_QUIC_DEBUG_LOG =
StringRef::from_lit("frontend-quic-debug-log");
constexpr size_t SHRPX_OBFUSCATED_NODE_LENGTH = 8;
@ -1171,6 +1173,7 @@ enum {
SHRPX_OPTID_FRONTEND_KEEP_ALIVE_TIMEOUT,
SHRPX_OPTID_FRONTEND_MAX_REQUESTS,
SHRPX_OPTID_FRONTEND_NO_TLS,
SHRPX_OPTID_FRONTEND_QUIC_DEBUG_LOG,
SHRPX_OPTID_FRONTEND_QUIC_IDLE_TIMEOUT,
SHRPX_OPTID_FRONTEND_READ_TIMEOUT,
SHRPX_OPTID_FRONTEND_WRITE_TIMEOUT,