nghttpx: Add --quic-idle-timeout option
This commit is contained in:
parent
c1bcf0f11a
commit
6931cb9d65
|
@ -181,6 +181,7 @@ OPTIONS = [
|
||||||
"no-bpf",
|
"no-bpf",
|
||||||
"http2-altsvc",
|
"http2-altsvc",
|
||||||
"frontend-http3-read-timeout",
|
"frontend-http3-read-timeout",
|
||||||
|
"quic-idle-timeout",
|
||||||
]
|
]
|
||||||
|
|
||||||
LOGVARS = [
|
LOGVARS = [
|
||||||
|
|
|
@ -2883,6 +2883,10 @@ Scripting:
|
||||||
#ifdef ENABLE_HTTP3
|
#ifdef ENABLE_HTTP3
|
||||||
out << R"(
|
out << R"(
|
||||||
QUIC:
|
QUIC:
|
||||||
|
--quic-idle-timeout=<DURATION>
|
||||||
|
Specify an idle timeout for QUIC connection.
|
||||||
|
Default: )"
|
||||||
|
<< config->quic.timeout.idle << R"(
|
||||||
--bpf-program-file=<PATH>
|
--bpf-program-file=<PATH>
|
||||||
Specify a path to eBPF program file reuseport_kern.o to
|
Specify a path to eBPF program file reuseport_kern.o to
|
||||||
direct an incoming QUIC UDP datagram to a correct
|
direct an incoming QUIC UDP datagram to a correct
|
||||||
|
@ -3598,6 +3602,7 @@ int main(int argc, char **argv) {
|
||||||
{SHRPX_OPT_HTTP2_ALTSVC.c_str(), required_argument, &flag, 171},
|
{SHRPX_OPT_HTTP2_ALTSVC.c_str(), required_argument, &flag, 171},
|
||||||
{SHRPX_OPT_FRONTEND_HTTP3_READ_TIMEOUT.c_str(), required_argument,
|
{SHRPX_OPT_FRONTEND_HTTP3_READ_TIMEOUT.c_str(), required_argument,
|
||||||
&flag, 172},
|
&flag, 172},
|
||||||
|
{SHRPX_OPT_QUIC_IDLE_TIMEOUT.c_str(), required_argument, &flag, 173},
|
||||||
{nullptr, 0, nullptr, 0}};
|
{nullptr, 0, nullptr, 0}};
|
||||||
|
|
||||||
int option_index = 0;
|
int option_index = 0;
|
||||||
|
@ -4418,6 +4423,10 @@ int main(int argc, char **argv) {
|
||||||
cmdcfgs.emplace_back(SHRPX_OPT_FRONTEND_HTTP3_READ_TIMEOUT,
|
cmdcfgs.emplace_back(SHRPX_OPT_FRONTEND_HTTP3_READ_TIMEOUT,
|
||||||
StringRef{optarg});
|
StringRef{optarg});
|
||||||
break;
|
break;
|
||||||
|
case 173:
|
||||||
|
// --quic-idle-timeout
|
||||||
|
cmdcfgs.emplace_back(SHRPX_OPT_QUIC_IDLE_TIMEOUT, StringRef{optarg});
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2092,6 +2092,9 @@ int option_lookup_token(const char *name, size_t namelen) {
|
||||||
if (util::strieq_l("dns-cache-timeou", name, 16)) {
|
if (util::strieq_l("dns-cache-timeou", name, 16)) {
|
||||||
return SHRPX_OPTID_DNS_CACHE_TIMEOUT;
|
return SHRPX_OPTID_DNS_CACHE_TIMEOUT;
|
||||||
}
|
}
|
||||||
|
if (util::strieq_l("quic-idle-timeou", name, 16)) {
|
||||||
|
return SHRPX_OPTID_QUIC_IDLE_TIMEOUT;
|
||||||
|
}
|
||||||
if (util::strieq_l("worker-read-burs", name, 16)) {
|
if (util::strieq_l("worker-read-burs", name, 16)) {
|
||||||
return SHRPX_OPTID_WORKER_READ_BURST;
|
return SHRPX_OPTID_WORKER_READ_BURST;
|
||||||
}
|
}
|
||||||
|
@ -3879,6 +3882,12 @@ int parse_config(Config *config, int optid, const StringRef &opt,
|
||||||
case SHRPX_OPTID_FRONTEND_HTTP3_READ_TIMEOUT:
|
case SHRPX_OPTID_FRONTEND_HTTP3_READ_TIMEOUT:
|
||||||
return parse_duration(&config->conn.upstream.timeout.http3_read, opt,
|
return parse_duration(&config->conn.upstream.timeout.http3_read, opt,
|
||||||
optarg);
|
optarg);
|
||||||
|
case SHRPX_OPTID_QUIC_IDLE_TIMEOUT:
|
||||||
|
#ifdef ENABLE_HTTP3
|
||||||
|
return parse_duration(&config->quic.timeout.idle, opt, optarg);
|
||||||
|
#else // !ENABLE_HTTP3
|
||||||
|
return 0;
|
||||||
|
#endif // !ENABLE_HTTP3
|
||||||
case SHRPX_OPTID_CONF:
|
case SHRPX_OPTID_CONF:
|
||||||
LOG(WARN) << "conf: ignored";
|
LOG(WARN) << "conf: ignored";
|
||||||
|
|
||||||
|
|
|
@ -369,6 +369,8 @@ constexpr auto SHRPX_OPT_NO_BPF = StringRef::from_lit("no-bpf");
|
||||||
constexpr auto SHRPX_OPT_HTTP2_ALTSVC = StringRef::from_lit("http2-altsvc");
|
constexpr auto SHRPX_OPT_HTTP2_ALTSVC = StringRef::from_lit("http2-altsvc");
|
||||||
constexpr auto SHRPX_OPT_FRONTEND_HTTP3_READ_TIMEOUT =
|
constexpr auto SHRPX_OPT_FRONTEND_HTTP3_READ_TIMEOUT =
|
||||||
StringRef::from_lit("frontend-http3-read-timeout");
|
StringRef::from_lit("frontend-http3-read-timeout");
|
||||||
|
constexpr auto SHRPX_OPT_QUIC_IDLE_TIMEOUT =
|
||||||
|
StringRef::from_lit("quic-idle-timeout");
|
||||||
|
|
||||||
constexpr size_t SHRPX_OBFUSCATED_NODE_LENGTH = 8;
|
constexpr size_t SHRPX_OBFUSCATED_NODE_LENGTH = 8;
|
||||||
|
|
||||||
|
@ -1207,6 +1209,7 @@ enum {
|
||||||
SHRPX_OPTID_PRIVATE_KEY_FILE,
|
SHRPX_OPTID_PRIVATE_KEY_FILE,
|
||||||
SHRPX_OPTID_PRIVATE_KEY_PASSWD_FILE,
|
SHRPX_OPTID_PRIVATE_KEY_PASSWD_FILE,
|
||||||
SHRPX_OPTID_PSK_SECRETS,
|
SHRPX_OPTID_PSK_SECRETS,
|
||||||
|
SHRPX_OPTID_QUIC_IDLE_TIMEOUT,
|
||||||
SHRPX_OPTID_READ_BURST,
|
SHRPX_OPTID_READ_BURST,
|
||||||
SHRPX_OPTID_READ_RATE,
|
SHRPX_OPTID_READ_RATE,
|
||||||
SHRPX_OPTID_REDIRECT_HTTPS_PORT,
|
SHRPX_OPTID_REDIRECT_HTTPS_PORT,
|
||||||
|
|
Loading…
Reference in New Issue