nghttpx: Use defined string iteral when defining long_options

This commit is contained in:
Tatsuhiro Tsujikawa 2015-05-29 22:48:46 +09:00
parent 34efc6b7a4
commit 3d59c6c0b7
3 changed files with 195 additions and 273 deletions

View File

@ -1448,95 +1448,101 @@ int main(int argc, char **argv) {
while (1) { while (1) {
static int flag = 0; static int flag = 0;
static option long_options[] = { static option long_options[] = {
{"daemon", no_argument, nullptr, 'D'}, {SHRPX_OPT_DAEMON, no_argument, nullptr, 'D'},
{"log-level", required_argument, nullptr, 'L'}, {SHRPX_OPT_LOG_LEVEL, required_argument, nullptr, 'L'},
{"backend", required_argument, nullptr, 'b'}, {SHRPX_OPT_BACKEND, required_argument, nullptr, 'b'},
{"http2-max-concurrent-streams", required_argument, nullptr, 'c'}, {SHRPX_OPT_HTTP2_MAX_CONCURRENT_STREAMS, required_argument, nullptr,
{"frontend", required_argument, nullptr, 'f'}, 'c'},
{SHRPX_OPT_FRONTEND, required_argument, nullptr, 'f'},
{"help", no_argument, nullptr, 'h'}, {"help", no_argument, nullptr, 'h'},
{"insecure", no_argument, nullptr, 'k'}, {SHRPX_OPT_INSECURE, no_argument, nullptr, 'k'},
{"workers", required_argument, nullptr, 'n'}, {SHRPX_OPT_WORKERS, required_argument, nullptr, 'n'},
{"client-proxy", no_argument, nullptr, 'p'}, {SHRPX_OPT_CLIENT_PROXY, no_argument, nullptr, 'p'},
{"http2-proxy", no_argument, nullptr, 's'}, {SHRPX_OPT_HTTP2_PROXY, no_argument, nullptr, 's'},
{"version", no_argument, nullptr, 'v'}, {"version", no_argument, nullptr, 'v'},
{"frontend-frame-debug", no_argument, nullptr, 'o'}, {SHRPX_OPT_FRONTEND_FRAME_DEBUG, no_argument, nullptr, 'o'},
{"add-x-forwarded-for", no_argument, &flag, 1}, {SHRPX_OPT_ADD_X_FORWARDED_FOR, no_argument, &flag, 1},
{"frontend-http2-read-timeout", required_argument, &flag, 2}, {SHRPX_OPT_FRONTEND_HTTP2_READ_TIMEOUT, required_argument, &flag, 2},
{"frontend-read-timeout", required_argument, &flag, 3}, {SHRPX_OPT_FRONTEND_READ_TIMEOUT, required_argument, &flag, 3},
{"frontend-write-timeout", required_argument, &flag, 4}, {SHRPX_OPT_FRONTEND_WRITE_TIMEOUT, required_argument, &flag, 4},
{"backend-read-timeout", required_argument, &flag, 5}, {SHRPX_OPT_BACKEND_READ_TIMEOUT, required_argument, &flag, 5},
{"backend-write-timeout", required_argument, &flag, 6}, {SHRPX_OPT_BACKEND_WRITE_TIMEOUT, required_argument, &flag, 6},
{"accesslog-file", required_argument, &flag, 7}, {SHRPX_OPT_ACCESSLOG_FILE, required_argument, &flag, 7},
{"backend-keep-alive-timeout", required_argument, &flag, 8}, {SHRPX_OPT_BACKEND_KEEP_ALIVE_TIMEOUT, required_argument, &flag, 8},
{"frontend-http2-window-bits", required_argument, &flag, 9}, {SHRPX_OPT_FRONTEND_HTTP2_WINDOW_BITS, required_argument, &flag, 9},
{"pid-file", required_argument, &flag, 10}, {SHRPX_OPT_PID_FILE, required_argument, &flag, 10},
{"user", required_argument, &flag, 11}, {SHRPX_OPT_USER, required_argument, &flag, 11},
{"conf", required_argument, &flag, 12}, {"conf", required_argument, &flag, 12},
{"syslog-facility", required_argument, &flag, 14}, {SHRPX_OPT_SYSLOG_FACILITY, required_argument, &flag, 14},
{"backlog", required_argument, &flag, 15}, {SHRPX_OPT_BACKLOG, required_argument, &flag, 15},
{"ciphers", required_argument, &flag, 16}, {SHRPX_OPT_CIPHERS, required_argument, &flag, 16},
{"client", no_argument, &flag, 17}, {SHRPX_OPT_CLIENT, no_argument, &flag, 17},
{"backend-http2-window-bits", required_argument, &flag, 18}, {SHRPX_OPT_BACKEND_HTTP2_WINDOW_BITS, required_argument, &flag, 18},
{"cacert", required_argument, &flag, 19}, {SHRPX_OPT_CACERT, required_argument, &flag, 19},
{"backend-ipv4", no_argument, &flag, 20}, {SHRPX_OPT_BACKEND_IPV4, no_argument, &flag, 20},
{"backend-ipv6", no_argument, &flag, 21}, {SHRPX_OPT_BACKEND_IPV6, no_argument, &flag, 21},
{"private-key-passwd-file", required_argument, &flag, 22}, {SHRPX_OPT_PRIVATE_KEY_PASSWD_FILE, required_argument, &flag, 22},
{"no-via", no_argument, &flag, 23}, {SHRPX_OPT_NO_VIA, no_argument, &flag, 23},
{"subcert", required_argument, &flag, 24}, {SHRPX_OPT_SUBCERT, required_argument, &flag, 24},
{"http2-bridge", no_argument, &flag, 25}, {SHRPX_OPT_HTTP2_BRIDGE, no_argument, &flag, 25},
{"backend-http-proxy-uri", required_argument, &flag, 26}, {SHRPX_OPT_BACKEND_HTTP_PROXY_URI, required_argument, &flag, 26},
{"backend-no-tls", no_argument, &flag, 27}, {SHRPX_OPT_BACKEND_NO_TLS, no_argument, &flag, 27},
{"frontend-no-tls", no_argument, &flag, 29}, {SHRPX_OPT_FRONTEND_NO_TLS, no_argument, &flag, 29},
{"backend-tls-sni-field", required_argument, &flag, 31}, {SHRPX_OPT_BACKEND_TLS_SNI_FIELD, required_argument, &flag, 31},
{"dh-param-file", required_argument, &flag, 33}, {SHRPX_OPT_DH_PARAM_FILE, required_argument, &flag, 33},
{"read-rate", required_argument, &flag, 34}, {SHRPX_OPT_READ_RATE, required_argument, &flag, 34},
{"read-burst", required_argument, &flag, 35}, {SHRPX_OPT_READ_BURST, required_argument, &flag, 35},
{"write-rate", required_argument, &flag, 36}, {SHRPX_OPT_WRITE_RATE, required_argument, &flag, 36},
{"write-burst", required_argument, &flag, 37}, {SHRPX_OPT_WRITE_BURST, required_argument, &flag, 37},
{"npn-list", required_argument, &flag, 38}, {SHRPX_OPT_NPN_LIST, required_argument, &flag, 38},
{"verify-client", no_argument, &flag, 39}, {SHRPX_OPT_VERIFY_CLIENT, no_argument, &flag, 39},
{"verify-client-cacert", required_argument, &flag, 40}, {SHRPX_OPT_VERIFY_CLIENT_CACERT, required_argument, &flag, 40},
{"client-private-key-file", required_argument, &flag, 41}, {SHRPX_OPT_CLIENT_PRIVATE_KEY_FILE, required_argument, &flag, 41},
{"client-cert-file", required_argument, &flag, 42}, {SHRPX_OPT_CLIENT_CERT_FILE, required_argument, &flag, 42},
{"frontend-http2-dump-request-header", required_argument, &flag, 43}, {SHRPX_OPT_FRONTEND_HTTP2_DUMP_REQUEST_HEADER, required_argument, &flag,
{"frontend-http2-dump-response-header", required_argument, &flag, 44}, 43},
{"http2-no-cookie-crumbling", no_argument, &flag, 45}, {SHRPX_OPT_FRONTEND_HTTP2_DUMP_RESPONSE_HEADER, required_argument,
{"frontend-http2-connection-window-bits", required_argument, &flag, 46}, &flag, 44},
{"backend-http2-connection-window-bits", required_argument, &flag, 47}, {SHRPX_OPT_HTTP2_NO_COOKIE_CRUMBLING, no_argument, &flag, 45},
{"tls-proto-list", required_argument, &flag, 48}, {SHRPX_OPT_FRONTEND_HTTP2_CONNECTION_WINDOW_BITS, required_argument,
{"padding", required_argument, &flag, 49}, &flag, 46},
{"worker-read-rate", required_argument, &flag, 50}, {SHRPX_OPT_BACKEND_HTTP2_CONNECTION_WINDOW_BITS, required_argument,
{"worker-read-burst", required_argument, &flag, 51}, &flag, 47},
{"worker-write-rate", required_argument, &flag, 52}, {SHRPX_OPT_TLS_PROTO_LIST, required_argument, &flag, 48},
{"worker-write-burst", required_argument, &flag, 53}, {SHRPX_OPT_PADDING, required_argument, &flag, 49},
{"altsvc", required_argument, &flag, 54}, {SHRPX_OPT_WORKER_READ_RATE, required_argument, &flag, 50},
{"add-response-header", required_argument, &flag, 55}, {SHRPX_OPT_WORKER_READ_BURST, required_argument, &flag, 51},
{"worker-frontend-connections", required_argument, &flag, 56}, {SHRPX_OPT_WORKER_WRITE_RATE, required_argument, &flag, 52},
{"accesslog-syslog", no_argument, &flag, 57}, {SHRPX_OPT_WORKER_WRITE_BURST, required_argument, &flag, 53},
{"errorlog-file", required_argument, &flag, 58}, {SHRPX_OPT_ALTSVC, required_argument, &flag, 54},
{"errorlog-syslog", no_argument, &flag, 59}, {SHRPX_OPT_ADD_RESPONSE_HEADER, required_argument, &flag, 55},
{"stream-read-timeout", required_argument, &flag, 60}, {SHRPX_OPT_WORKER_FRONTEND_CONNECTIONS, required_argument, &flag, 56},
{"stream-write-timeout", required_argument, &flag, 61}, {SHRPX_OPT_ACCESSLOG_SYSLOG, no_argument, &flag, 57},
{"no-location-rewrite", no_argument, &flag, 62}, {SHRPX_OPT_ERRORLOG_FILE, required_argument, &flag, 58},
{"backend-http1-connections-per-host", required_argument, &flag, 63}, {SHRPX_OPT_ERRORLOG_SYSLOG, no_argument, &flag, 59},
{"listener-disable-timeout", required_argument, &flag, 64}, {SHRPX_OPT_STREAM_READ_TIMEOUT, required_argument, &flag, 60},
{"strip-incoming-x-forwarded-for", no_argument, &flag, 65}, {SHRPX_OPT_STREAM_WRITE_TIMEOUT, required_argument, &flag, 61},
{"accesslog-format", required_argument, &flag, 66}, {SHRPX_OPT_NO_LOCATION_REWRITE, no_argument, &flag, 62},
{"backend-http1-connections-per-frontend", required_argument, &flag, {SHRPX_OPT_BACKEND_HTTP1_CONNECTIONS_PER_HOST, required_argument, &flag,
67}, 63},
{"tls-ticket-key-file", required_argument, &flag, 68}, {SHRPX_OPT_LISTENER_DISABLE_TIMEOUT, required_argument, &flag, 64},
{"rlimit-nofile", required_argument, &flag, 69}, {SHRPX_OPT_STRIP_INCOMING_X_FORWARDED_FOR, no_argument, &flag, 65},
{"tls-ctx-per-worker", no_argument, &flag, 70}, {SHRPX_OPT_ACCESSLOG_FORMAT, required_argument, &flag, 66},
{"backend-response-buffer", required_argument, &flag, 71}, {SHRPX_OPT_BACKEND_HTTP1_CONNECTIONS_PER_FRONTEND, required_argument,
{"backend-request-buffer", required_argument, &flag, 72}, &flag, 67},
{"no-host-rewrite", no_argument, &flag, 73}, {SHRPX_OPT_TLS_TICKET_KEY_FILE, required_argument, &flag, 68},
{"no-server-push", no_argument, &flag, 74}, {SHRPX_OPT_RLIMIT_NOFILE, required_argument, &flag, 69},
{"backend-http2-connections-per-worker", required_argument, &flag, 76}, {SHRPX_OPT_BACKEND_RESPONSE_BUFFER, required_argument, &flag, 71},
{"fetch-ocsp-response-file", required_argument, &flag, 77}, {SHRPX_OPT_BACKEND_REQUEST_BUFFER, required_argument, &flag, 72},
{"ocsp-update-interval", required_argument, &flag, 78}, {SHRPX_OPT_NO_HOST_REWRITE, no_argument, &flag, 73},
{"no-ocsp", no_argument, &flag, 79}, {SHRPX_OPT_NO_SERVER_PUSH, no_argument, &flag, 74},
{"header-field-buffer", required_argument, &flag, 80}, {SHRPX_OPT_BACKEND_HTTP2_CONNECTIONS_PER_WORKER, required_argument,
{"max-header-fields", required_argument, &flag, 81}, &flag, 76},
{SHRPX_OPT_FETCH_OCSP_RESPONSE_FILE, required_argument, &flag, 77},
{SHRPX_OPT_OCSP_UPDATE_INTERVAL, required_argument, &flag, 78},
{SHRPX_OPT_NO_OCSP, no_argument, &flag, 79},
{SHRPX_OPT_HEADER_FIELD_BUFFER, required_argument, &flag, 80},
{SHRPX_OPT_MAX_HEADER_FIELDS, required_argument, &flag, 81},
{nullptr, 0, nullptr, 0}}; {nullptr, 0, nullptr, 0}};
int option_index = 0; int option_index = 0;

View File

@ -62,107 +62,6 @@ using namespace nghttp2;
namespace shrpx { namespace shrpx {
const char SHRPX_OPT_PRIVATE_KEY_FILE[] = "private-key-file";
const char SHRPX_OPT_PRIVATE_KEY_PASSWD_FILE[] = "private-key-passwd-file";
const char SHRPX_OPT_CERTIFICATE_FILE[] = "certificate-file";
const char SHRPX_OPT_DH_PARAM_FILE[] = "dh-param-file";
const char SHRPX_OPT_SUBCERT[] = "subcert";
const char SHRPX_OPT_BACKEND[] = "backend";
const char SHRPX_OPT_FRONTEND[] = "frontend";
const char SHRPX_OPT_WORKERS[] = "workers";
const char SHRPX_OPT_HTTP2_MAX_CONCURRENT_STREAMS[] =
"http2-max-concurrent-streams";
const char SHRPX_OPT_LOG_LEVEL[] = "log-level";
const char SHRPX_OPT_DAEMON[] = "daemon";
const char SHRPX_OPT_HTTP2_PROXY[] = "http2-proxy";
const char SHRPX_OPT_HTTP2_BRIDGE[] = "http2-bridge";
const char SHRPX_OPT_CLIENT_PROXY[] = "client-proxy";
const char SHRPX_OPT_ADD_X_FORWARDED_FOR[] = "add-x-forwarded-for";
const char SHRPX_OPT_STRIP_INCOMING_X_FORWARDED_FOR[] =
"strip-incoming-x-forwarded-for";
const char SHRPX_OPT_NO_VIA[] = "no-via";
const char SHRPX_OPT_FRONTEND_HTTP2_READ_TIMEOUT[] =
"frontend-http2-read-timeout";
const char SHRPX_OPT_FRONTEND_READ_TIMEOUT[] = "frontend-read-timeout";
const char SHRPX_OPT_FRONTEND_WRITE_TIMEOUT[] = "frontend-write-timeout";
const char SHRPX_OPT_BACKEND_READ_TIMEOUT[] = "backend-read-timeout";
const char SHRPX_OPT_BACKEND_WRITE_TIMEOUT[] = "backend-write-timeout";
const char SHRPX_OPT_STREAM_READ_TIMEOUT[] = "stream-read-timeout";
const char SHRPX_OPT_STREAM_WRITE_TIMEOUT[] = "stream-write-timeout";
const char SHRPX_OPT_ACCESSLOG_FILE[] = "accesslog-file";
const char SHRPX_OPT_ACCESSLOG_SYSLOG[] = "accesslog-syslog";
const char SHRPX_OPT_ACCESSLOG_FORMAT[] = "accesslog-format";
const char SHRPX_OPT_ERRORLOG_FILE[] = "errorlog-file";
const char SHRPX_OPT_ERRORLOG_SYSLOG[] = "errorlog-syslog";
const char SHRPX_OPT_BACKEND_KEEP_ALIVE_TIMEOUT[] =
"backend-keep-alive-timeout";
const char SHRPX_OPT_FRONTEND_HTTP2_WINDOW_BITS[] =
"frontend-http2-window-bits";
const char SHRPX_OPT_BACKEND_HTTP2_WINDOW_BITS[] = "backend-http2-window-bits";
const char SHRPX_OPT_FRONTEND_HTTP2_CONNECTION_WINDOW_BITS[] =
"frontend-http2-connection-window-bits";
const char SHRPX_OPT_BACKEND_HTTP2_CONNECTION_WINDOW_BITS[] =
"backend-http2-connection-window-bits";
const char SHRPX_OPT_FRONTEND_NO_TLS[] = "frontend-no-tls";
const char SHRPX_OPT_BACKEND_NO_TLS[] = "backend-no-tls";
const char SHRPX_OPT_BACKEND_TLS_SNI_FIELD[] = "backend-tls-sni-field";
const char SHRPX_OPT_PID_FILE[] = "pid-file";
const char SHRPX_OPT_USER[] = "user";
const char SHRPX_OPT_SYSLOG_FACILITY[] = "syslog-facility";
const char SHRPX_OPT_BACKLOG[] = "backlog";
const char SHRPX_OPT_CIPHERS[] = "ciphers";
const char SHRPX_OPT_CLIENT[] = "client";
const char SHRPX_OPT_INSECURE[] = "insecure";
const char SHRPX_OPT_CACERT[] = "cacert";
const char SHRPX_OPT_BACKEND_IPV4[] = "backend-ipv4";
const char SHRPX_OPT_BACKEND_IPV6[] = "backend-ipv6";
const char SHRPX_OPT_BACKEND_HTTP_PROXY_URI[] = "backend-http-proxy-uri";
const char SHRPX_OPT_READ_RATE[] = "read-rate";
const char SHRPX_OPT_READ_BURST[] = "read-burst";
const char SHRPX_OPT_WRITE_RATE[] = "write-rate";
const char SHRPX_OPT_WRITE_BURST[] = "write-burst";
const char SHRPX_OPT_WORKER_READ_RATE[] = "worker-read-rate";
const char SHRPX_OPT_WORKER_READ_BURST[] = "worker-read-burst";
const char SHRPX_OPT_WORKER_WRITE_RATE[] = "worker-write-rate";
const char SHRPX_OPT_WORKER_WRITE_BURST[] = "worker-write-burst";
const char SHRPX_OPT_NPN_LIST[] = "npn-list";
const char SHRPX_OPT_TLS_PROTO_LIST[] = "tls-proto-list";
const char SHRPX_OPT_VERIFY_CLIENT[] = "verify-client";
const char SHRPX_OPT_VERIFY_CLIENT_CACERT[] = "verify-client-cacert";
const char SHRPX_OPT_CLIENT_PRIVATE_KEY_FILE[] = "client-private-key-file";
const char SHRPX_OPT_CLIENT_CERT_FILE[] = "client-cert-file";
const char SHRPX_OPT_FRONTEND_HTTP2_DUMP_REQUEST_HEADER[] =
"frontend-http2-dump-request-header";
const char SHRPX_OPT_FRONTEND_HTTP2_DUMP_RESPONSE_HEADER[] =
"frontend-http2-dump-response-header";
const char SHRPX_OPT_HTTP2_NO_COOKIE_CRUMBLING[] = "http2-no-cookie-crumbling";
const char SHRPX_OPT_FRONTEND_FRAME_DEBUG[] = "frontend-frame-debug";
const char SHRPX_OPT_PADDING[] = "padding";
const char SHRPX_OPT_ALTSVC[] = "altsvc";
const char SHRPX_OPT_ADD_RESPONSE_HEADER[] = "add-response-header";
const char SHRPX_OPT_WORKER_FRONTEND_CONNECTIONS[] =
"worker-frontend-connections";
const char SHRPX_OPT_NO_LOCATION_REWRITE[] = "no-location-rewrite";
const char SHRPX_OPT_NO_HOST_REWRITE[] = "no-host-rewrite";
const char SHRPX_OPT_BACKEND_HTTP1_CONNECTIONS_PER_HOST[] =
"backend-http1-connections-per-host";
const char SHRPX_OPT_BACKEND_HTTP1_CONNECTIONS_PER_FRONTEND[] =
"backend-http1-connections-per-frontend";
const char SHRPX_OPT_LISTENER_DISABLE_TIMEOUT[] = "listener-disable-timeout";
const char SHRPX_OPT_TLS_TICKET_KEY_FILE[] = "tls-ticket-key-file";
const char SHRPX_OPT_RLIMIT_NOFILE[] = "rlimit-nofile";
const char SHRPX_OPT_BACKEND_REQUEST_BUFFER[] = "backend-request-buffer";
const char SHRPX_OPT_BACKEND_RESPONSE_BUFFER[] = "backend-response-buffer";
const char SHRPX_OPT_NO_SERVER_PUSH[] = "no-server-push";
const char SHRPX_OPT_BACKEND_HTTP2_CONNECTIONS_PER_WORKER[] =
"backend-http2-connections-per-worker";
const char SHRPX_OPT_FETCH_OCSP_RESPONSE_FILE[] = "fetch-ocsp-response-file";
const char SHRPX_OPT_OCSP_UPDATE_INTERVAL[] = "ocsp-update-interval";
const char SHRPX_OPT_NO_OCSP[] = "no-ocsp";
const char SHRPX_OPT_HEADER_FIELD_BUFFER[] = "header-field-buffer";
const char SHRPX_OPT_MAX_HEADER_FIELDS[] = "max-header-fields";
namespace { namespace {
Config *config = nullptr; Config *config = nullptr;
} // namespace } // namespace

View File

@ -61,92 +61,109 @@ class CertLookupTree;
constexpr char SHRPX_UNIX_PATH_PREFIX[] = "unix:"; constexpr char SHRPX_UNIX_PATH_PREFIX[] = "unix:";
extern const char SHRPX_OPT_PRIVATE_KEY_FILE[]; constexpr char SHRPX_OPT_PRIVATE_KEY_FILE[] = "private-key-file";
extern const char SHRPX_OPT_PRIVATE_KEY_PASSWD_FILE[]; constexpr char SHRPX_OPT_PRIVATE_KEY_PASSWD_FILE[] = "private-key-passwd-file";
extern const char SHRPX_OPT_CERTIFICATE_FILE[]; constexpr char SHRPX_OPT_CERTIFICATE_FILE[] = "certificate-file";
extern const char SHRPX_OPT_DH_PARAM_FILE[]; constexpr char SHRPX_OPT_DH_PARAM_FILE[] = "dh-param-file";
extern const char SHRPX_OPT_SUBCERT[]; constexpr char SHRPX_OPT_SUBCERT[] = "subcert";
extern const char SHRPX_OPT_BACKEND[]; constexpr char SHRPX_OPT_BACKEND[] = "backend";
extern const char SHRPX_OPT_FRONTEND[]; constexpr char SHRPX_OPT_FRONTEND[] = "frontend";
extern const char SHRPX_OPT_WORKERS[]; constexpr char SHRPX_OPT_WORKERS[] = "workers";
extern const char SHRPX_OPT_HTTP2_MAX_CONCURRENT_STREAMS[]; constexpr char SHRPX_OPT_HTTP2_MAX_CONCURRENT_STREAMS[] =
extern const char SHRPX_OPT_LOG_LEVEL[]; "http2-max-concurrent-streams";
extern const char SHRPX_OPT_DAEMON[]; constexpr char SHRPX_OPT_LOG_LEVEL[] = "log-level";
extern const char SHRPX_OPT_HTTP2_PROXY[]; constexpr char SHRPX_OPT_DAEMON[] = "daemon";
extern const char SHRPX_OPT_HTTP2_BRIDGE[]; constexpr char SHRPX_OPT_HTTP2_PROXY[] = "http2-proxy";
extern const char SHRPX_OPT_CLIENT_PROXY[]; constexpr char SHRPX_OPT_HTTP2_BRIDGE[] = "http2-bridge";
extern const char SHRPX_OPT_ADD_X_FORWARDED_FOR[]; constexpr char SHRPX_OPT_CLIENT_PROXY[] = "client-proxy";
extern const char SHRPX_OPT_STRIP_INCOMING_X_FORWARDED_FOR[]; constexpr char SHRPX_OPT_ADD_X_FORWARDED_FOR[] = "add-x-forwarded-for";
extern const char SHRPX_OPT_NO_VIA[]; constexpr char SHRPX_OPT_STRIP_INCOMING_X_FORWARDED_FOR[] =
extern const char SHRPX_OPT_FRONTEND_HTTP2_READ_TIMEOUT[]; "strip-incoming-x-forwarded-for";
extern const char SHRPX_OPT_FRONTEND_READ_TIMEOUT[]; constexpr char SHRPX_OPT_NO_VIA[] = "no-via";
extern const char SHRPX_OPT_FRONTEND_WRITE_TIMEOUT[]; constexpr char SHRPX_OPT_FRONTEND_HTTP2_READ_TIMEOUT[] =
extern const char SHRPX_OPT_BACKEND_READ_TIMEOUT[]; "frontend-http2-read-timeout";
extern const char SHRPX_OPT_BACKEND_WRITE_TIMEOUT[]; constexpr char SHRPX_OPT_FRONTEND_READ_TIMEOUT[] = "frontend-read-timeout";
extern const char SHRPX_OPT_STREAM_READ_TIMEOUT[]; constexpr char SHRPX_OPT_FRONTEND_WRITE_TIMEOUT[] = "frontend-write-timeout";
extern const char SHRPX_OPT_STREAM_WRITE_TIMEOUT[]; constexpr char SHRPX_OPT_BACKEND_READ_TIMEOUT[] = "backend-read-timeout";
extern const char SHRPX_OPT_ACCESSLOG_FILE[]; constexpr char SHRPX_OPT_BACKEND_WRITE_TIMEOUT[] = "backend-write-timeout";
extern const char SHRPX_OPT_ACCESSLOG_SYSLOG[]; constexpr char SHRPX_OPT_STREAM_READ_TIMEOUT[] = "stream-read-timeout";
extern const char SHRPX_OPT_ACCESSLOG_FORMAT[]; constexpr char SHRPX_OPT_STREAM_WRITE_TIMEOUT[] = "stream-write-timeout";
extern const char SHRPX_OPT_ERRORLOG_FILE[]; constexpr char SHRPX_OPT_ACCESSLOG_FILE[] = "accesslog-file";
extern const char SHRPX_OPT_ERRORLOG_SYSLOG[]; constexpr char SHRPX_OPT_ACCESSLOG_SYSLOG[] = "accesslog-syslog";
extern const char SHRPX_OPT_BACKEND_KEEP_ALIVE_TIMEOUT[]; constexpr char SHRPX_OPT_ACCESSLOG_FORMAT[] = "accesslog-format";
extern const char SHRPX_OPT_FRONTEND_HTTP2_WINDOW_BITS[]; constexpr char SHRPX_OPT_ERRORLOG_FILE[] = "errorlog-file";
extern const char SHRPX_OPT_BACKEND_HTTP2_WINDOW_BITS[]; constexpr char SHRPX_OPT_ERRORLOG_SYSLOG[] = "errorlog-syslog";
extern const char SHRPX_OPT_FRONTEND_HTTP2_CONNECTION_WINDOW_BITS[]; constexpr char SHRPX_OPT_BACKEND_KEEP_ALIVE_TIMEOUT[] =
extern const char SHRPX_OPT_BACKEND_HTTP2_CONNECTION_WINDOW_BITS[]; "backend-keep-alive-timeout";
extern const char SHRPX_OPT_FRONTEND_NO_TLS[]; constexpr char SHRPX_OPT_FRONTEND_HTTP2_WINDOW_BITS[] =
extern const char SHRPX_OPT_BACKEND_NO_TLS[]; "frontend-http2-window-bits";
extern const char SHRPX_OPT_PID_FILE[]; constexpr char SHRPX_OPT_BACKEND_HTTP2_WINDOW_BITS[] =
extern const char SHRPX_OPT_USER[]; "backend-http2-window-bits";
extern const char SHRPX_OPT_SYSLOG_FACILITY[]; constexpr char SHRPX_OPT_FRONTEND_HTTP2_CONNECTION_WINDOW_BITS[] =
extern const char SHRPX_OPT_BACKLOG[]; "frontend-http2-connection-window-bits";
extern const char SHRPX_OPT_CIPHERS[]; constexpr char SHRPX_OPT_BACKEND_HTTP2_CONNECTION_WINDOW_BITS[] =
extern const char SHRPX_OPT_CLIENT[]; "backend-http2-connection-window-bits";
extern const char SHRPX_OPT_INSECURE[]; constexpr char SHRPX_OPT_FRONTEND_NO_TLS[] = "frontend-no-tls";
extern const char SHRPX_OPT_CACERT[]; constexpr char SHRPX_OPT_BACKEND_NO_TLS[] = "backend-no-tls";
extern const char SHRPX_OPT_BACKEND_IPV4[]; constexpr char SHRPX_OPT_BACKEND_TLS_SNI_FIELD[] = "backend-tls-sni-field";
extern const char SHRPX_OPT_BACKEND_IPV6[]; constexpr char SHRPX_OPT_PID_FILE[] = "pid-file";
extern const char SHRPX_OPT_BACKEND_HTTP_PROXY_URI[]; constexpr char SHRPX_OPT_USER[] = "user";
extern const char SHRPX_OPT_BACKEND_TLS_SNI_FIELD[]; constexpr char SHRPX_OPT_SYSLOG_FACILITY[] = "syslog-facility";
extern const char SHRPX_OPT_READ_RATE[]; constexpr char SHRPX_OPT_BACKLOG[] = "backlog";
extern const char SHRPX_OPT_READ_BURST[]; constexpr char SHRPX_OPT_CIPHERS[] = "ciphers";
extern const char SHRPX_OPT_WRITE_RATE[]; constexpr char SHRPX_OPT_CLIENT[] = "client";
extern const char SHRPX_OPT_WRITE_BURST[]; constexpr char SHRPX_OPT_INSECURE[] = "insecure";
extern const char SHRPX_OPT_WORKER_READ_RATE[]; constexpr char SHRPX_OPT_CACERT[] = "cacert";
extern const char SHRPX_OPT_WORKER_READ_BURST[]; constexpr char SHRPX_OPT_BACKEND_IPV4[] = "backend-ipv4";
extern const char SHRPX_OPT_WORKER_WRITE_RATE[]; constexpr char SHRPX_OPT_BACKEND_IPV6[] = "backend-ipv6";
extern const char SHRPX_OPT_WORKER_WRITE_BURST[]; constexpr char SHRPX_OPT_BACKEND_HTTP_PROXY_URI[] = "backend-http-proxy-uri";
extern const char SHRPX_OPT_NPN_LIST[]; constexpr char SHRPX_OPT_READ_RATE[] = "read-rate";
extern const char SHRPX_OPT_TLS_PROTO_LIST[]; constexpr char SHRPX_OPT_READ_BURST[] = "read-burst";
extern const char SHRPX_OPT_VERIFY_CLIENT[]; constexpr char SHRPX_OPT_WRITE_RATE[] = "write-rate";
extern const char SHRPX_OPT_VERIFY_CLIENT_CACERT[]; constexpr char SHRPX_OPT_WRITE_BURST[] = "write-burst";
extern const char SHRPX_OPT_CLIENT_PRIVATE_KEY_FILE[]; constexpr char SHRPX_OPT_WORKER_READ_RATE[] = "worker-read-rate";
extern const char SHRPX_OPT_CLIENT_CERT_FILE[]; constexpr char SHRPX_OPT_WORKER_READ_BURST[] = "worker-read-burst";
extern const char SHRPX_OPT_FRONTEND_HTTP2_DUMP_REQUEST_HEADER[]; constexpr char SHRPX_OPT_WORKER_WRITE_RATE[] = "worker-write-rate";
extern const char SHRPX_OPT_FRONTEND_HTTP2_DUMP_RESPONSE_HEADER[]; constexpr char SHRPX_OPT_WORKER_WRITE_BURST[] = "worker-write-burst";
extern const char SHRPX_OPT_HTTP2_NO_COOKIE_CRUMBLING[]; constexpr char SHRPX_OPT_NPN_LIST[] = "npn-list";
extern const char SHRPX_OPT_FRONTEND_FRAME_DEBUG[]; constexpr char SHRPX_OPT_TLS_PROTO_LIST[] = "tls-proto-list";
extern const char SHRPX_OPT_PADDING[]; constexpr char SHRPX_OPT_VERIFY_CLIENT[] = "verify-client";
extern const char SHRPX_OPT_ALTSVC[]; constexpr char SHRPX_OPT_VERIFY_CLIENT_CACERT[] = "verify-client-cacert";
extern const char SHRPX_OPT_ADD_RESPONSE_HEADER[]; constexpr char SHRPX_OPT_CLIENT_PRIVATE_KEY_FILE[] = "client-private-key-file";
extern const char SHRPX_OPT_WORKER_FRONTEND_CONNECTIONS[]; constexpr char SHRPX_OPT_CLIENT_CERT_FILE[] = "client-cert-file";
extern const char SHRPX_OPT_NO_LOCATION_REWRITE[]; constexpr char SHRPX_OPT_FRONTEND_HTTP2_DUMP_REQUEST_HEADER[] =
extern const char SHRPX_OPT_NO_HOST_REWRITE[]; "frontend-http2-dump-request-header";
extern const char SHRPX_OPT_BACKEND_HTTP1_CONNECTIONS_PER_HOST[]; constexpr char SHRPX_OPT_FRONTEND_HTTP2_DUMP_RESPONSE_HEADER[] =
extern const char SHRPX_OPT_BACKEND_HTTP1_CONNECTIONS_PER_FRONTEND[]; "frontend-http2-dump-response-header";
extern const char SHRPX_OPT_LISTENER_DISABLE_TIMEOUT[]; constexpr char SHRPX_OPT_HTTP2_NO_COOKIE_CRUMBLING[] =
extern const char SHRPX_OPT_TLS_TICKET_KEY_FILE[]; "http2-no-cookie-crumbling";
extern const char SHRPX_OPT_RLIMIT_NOFILE[]; constexpr char SHRPX_OPT_FRONTEND_FRAME_DEBUG[] = "frontend-frame-debug";
extern const char SHRPX_OPT_BACKEND_REQUEST_BUFFER[]; constexpr char SHRPX_OPT_PADDING[] = "padding";
extern const char SHRPX_OPT_BACKEND_RESPONSE_BUFFER[]; constexpr char SHRPX_OPT_ALTSVC[] = "altsvc";
extern const char SHRPX_OPT_NO_SERVER_PUSH[]; constexpr char SHRPX_OPT_ADD_RESPONSE_HEADER[] = "add-response-header";
extern const char SHRPX_OPT_BACKEND_HTTP2_CONNECTIONS_PER_WORKER[]; constexpr char SHRPX_OPT_WORKER_FRONTEND_CONNECTIONS[] =
extern const char SHRPX_OPT_FETCH_OCSP_RESPONSE_FILE[]; "worker-frontend-connections";
extern const char SHRPX_OPT_OCSP_UPDATE_INTERVAL[]; constexpr char SHRPX_OPT_NO_LOCATION_REWRITE[] = "no-location-rewrite";
extern const char SHRPX_OPT_NO_OCSP[]; constexpr char SHRPX_OPT_NO_HOST_REWRITE[] = "no-host-rewrite";
extern const char SHRPX_OPT_HEADER_FIELD_BUFFER[]; constexpr char SHRPX_OPT_BACKEND_HTTP1_CONNECTIONS_PER_HOST[] =
extern const char SHRPX_OPT_MAX_HEADER_FIELDS[]; "backend-http1-connections-per-host";
constexpr char SHRPX_OPT_BACKEND_HTTP1_CONNECTIONS_PER_FRONTEND[] =
"backend-http1-connections-per-frontend";
constexpr char SHRPX_OPT_LISTENER_DISABLE_TIMEOUT[] =
"listener-disable-timeout";
constexpr char SHRPX_OPT_TLS_TICKET_KEY_FILE[] = "tls-ticket-key-file";
constexpr char SHRPX_OPT_RLIMIT_NOFILE[] = "rlimit-nofile";
constexpr char SHRPX_OPT_BACKEND_REQUEST_BUFFER[] = "backend-request-buffer";
constexpr char SHRPX_OPT_BACKEND_RESPONSE_BUFFER[] = "backend-response-buffer";
constexpr char SHRPX_OPT_NO_SERVER_PUSH[] = "no-server-push";
constexpr char SHRPX_OPT_BACKEND_HTTP2_CONNECTIONS_PER_WORKER[] =
"backend-http2-connections-per-worker";
constexpr char SHRPX_OPT_FETCH_OCSP_RESPONSE_FILE[] =
"fetch-ocsp-response-file";
constexpr char SHRPX_OPT_OCSP_UPDATE_INTERVAL[] = "ocsp-update-interval";
constexpr char SHRPX_OPT_NO_OCSP[] = "no-ocsp";
constexpr char SHRPX_OPT_HEADER_FIELD_BUFFER[] = "header-field-buffer";
constexpr char SHRPX_OPT_MAX_HEADER_FIELDS[] = "max-header-fields";
union sockaddr_union { union sockaddr_union {
sockaddr_storage storage; sockaddr_storage storage;