Lines Matching defs:config

311   auto config = get_config();
313 if (!(config->worker_process_grace_shutdown_period > 0.)) {
319 util::duration_from(config->worker_process_grace_shutdown_period);
323 config->worker_process_grace_shutdown_period;
359 auto config = get_config();
361 if (config->max_worker_processes &&
362 worker_processes.size() > config->max_worker_processes) {
393 auto config = get_config();
396 auto &pid_file = config->pid_file;
398 auto len = config->pid_file.size() + SUFFIX.size();
416 auto content = util::utos(config->pid) + '\n';
444 if (config->uid != 0) {
445 if (chown(pid_file.c_str(), config->uid, config->gid) == -1) {
544 auto config = get_config();
545 auto &listenerconf = config->conn.listener;
574 ipc_fd_str += util::utos(config->pid);
663 auto config = get_config();
664 auto &loggingconf = config->logging;
979 // Returns array of InheritedAddr constructed from |config|. This
981 // |config| is usually a current configuration.
983 get_inherited_addr_from_config(BlockAllocator &balloc, Config *config) {
987 auto &listenerconf = config->conn.listener;
1045 std::vector<InheritedAddr> get_inherited_addr_from_env(Config *config) {
1126 addr.host = make_string_ref(config->balloc, StringRef{path});
1180 addr.host = make_string_ref(config->balloc, StringRef{host.data()});
1298 int create_acceptor_socket(Config *config, std::vector<InheritedAddr> &iaddrs) {
1300 auto &listenerconf = config->conn.listener;
1308 if (config->uid != 0) {
1311 if (chown(addr.host.c_str(), config->uid, config->gid) == -1) {
1423 const Config *config) {
1424 auto &apiconf = config->api;
1425 auto &quicconf = config->quic;
1428 if (config->single_thread) {
1431 num_cid_prefix = config->num_worker;
1646 auto config = get_config();
1650 if (!config->single_process) {
1660 for (auto &addr : config->conn.listener.addrs) {
1678 if (!config->single_process) {
1699 if (config->single_process) {
1706 if (!config->single_process) {
1726 if (config->single_process) {
1736 if (config->single_process) {
1792 auto config = mod_config();
1794 if (config->daemon) {
1807 redirect_stderr_to_errorlog(config->logging);
1811 shrpx_sd_notifyf(0, "MAINPID=%d\n", config->pid);
1814 auto iaddrs = get_inherited_addr_from_env(config);
1816 if (create_acceptor_socket(config, iaddrs) != 0) {
1830 auto loop = ev_default_loop(config->ev_loop_flags);
1840 if (generate_cid_prefix(cid_prefixes, config) != 0) {
1845 if (!config->single_process) {
1883 if (!config->pid_file.empty()) {
1895 // config is now stale if reload has happened.
1935 void fill_default_config(Config *config) {
1936 config->num_worker = 1;
1937 config->conf_path = StringRef::from_lit("/etc/nghttpx/nghttpx.conf");
1938 config->pid = getpid();
1941 config->single_thread = true;
1945 config->ev_loop_flags = ev_recommended_backends() | EVBACKEND_KQUEUE;
1948 auto &tlsconf = config->tls;
2001 auto &httpconf = config->http;
2014 auto &http2conf = config->http2;
2077 auto &quicconf = config->quic;
2100 auto &http3conf = config->http3;
2112 auto &loggingconf = config->logging;
2116 parse_log_format(config->balloc, DEFAULT_ACCESSLOG_FORMAT);
2125 auto &connconf = config->conn;
2176 auto &apiconf = config->api;
2179 auto &dnsconf = config->dns;
2210 auto config = get_config();
2521 << config->conn.listener.backlog << R"(
2546 << config->num_worker << R"(
2557 << config->conn.upstream.ratelimit.read.rate << R"(
2563 << config->conn.upstream.ratelimit.read.burst << R"(
2568 << config->conn.upstream.ratelimit.write.rate << R"(
2574 << config->conn.upstream.ratelimit.write.burst << R"(
2599 << config->conn.upstream.worker_connections << R"(
2610 << config->conn.downstream->connections_per_host << R"(
2619 << config->conn.downstream->connections_per_frontend << R"(
2624 << config->rlimit_nofile << R"(
2630 << config->rlimit_memlock << R"(
2634 << util::utos_unit(config->conn.downstream->request_buffer_size) << R"(
2638 << util::utos_unit(config->conn.downstream->response_buffer_size) << R"(
2645 << config->conn.listener.fastopen << R"(
2654 << util::duration_str(config->conn.upstream.timeout.http2_read) << R"(
2658 << util::duration_str(config->conn.upstream.timeout.http3_read) << R"(
2662 << util::duration_str(config->conn.upstream.timeout.read) << R"(
2666 << util::duration_str(config->conn.upstream.timeout.write) << R"(
2671 << util::duration_str(config->conn.upstream.timeout.idle_read) << R"(
2676 << util::duration_str(config->http2.timeout.stream_read) << R"(
2681 << util::duration_str(config->http2.timeout.stream_write) << R"(
2685 << util::duration_str(config->conn.downstream->timeout.read) << R"(
2689 << util::duration_str(config->conn.downstream->timeout.write) << R"(
2694 << util::duration_str(config->conn.downstream->timeout.connect) << R"(
2699 << util::duration_str(config->conn.downstream->timeout.idle_read) << R"(
2705 << util::duration_str(config->conn.listener.timeout.sleep) << R"(
2710 << util::duration_str(config->http2.upstream.timeout.settings) << R"(
2715 << util::duration_str(config->http2.downstream.timeout.settings) << R"(
2726 << util::duration_str(config->conn.downstream->timeout.max_backoff) << R"(
2735 << config->tls.ciphers << R"(
2742 << config->tls.tls13_ciphers << R"(
2749 << config->tls.client.ciphers << R"(
2756 << config->tls.client.tls13_ciphers << R"(
2764 << config->tls.ecdh_curves << R"(
2912 << util::duration_str(config->tls.ticket.memcached.interval) << R"(
2921 << config->tls.ticket.memcached.max_retry << R"(
2926 << config->tls.ticket.memcached.max_fail << R"(
2941 << config->tls.ocsp.fetch_ocsp_response_file << R"(
2945 << util::duration_str(config->tls.ocsp.update_interval) << R"(
2986 << util::utos_unit(config->tls.dyn_rec.warmup_threshold) << R"(
2993 << util::duration_str(config->tls.dyn_rec.idle_timeout) << R"(
3052 << util::utos_unit(config->tls.max_early_data) << R"(
3061 << config->http2.upstream.max_concurrent_streams << R"(
3068 << config->http2.downstream.max_concurrent_streams << R"(
3073 << config->http2.upstream.window_size << R"(
3078 << config->http2.upstream.connection_window_size << R"(
3083 << config->http2.downstream.window_size << R"(
3088 << config->http2.downstream.connection_window_size << R"(
3131 << util::utos_unit(config->http2.upstream.encoder_dynamic_table_size)
3137 << util::utos_unit(config->http2.upstream.decoder_dynamic_table_size)
3146 << util::utos_unit(config->http2.downstream.encoder_dynamic_table_size)
3152 << util::utos_unit(config->http2.downstream.decoder_dynamic_table_size)
3242 << config->logging.error.file << R"(
3249 << str_syslog_facility(config->logging.syslog_facility) << R"(
3345 << util::utos_unit(config->http.request_header_field_buffer) << R"(
3351 << config->http.max_request_header_fields << R"(
3358 << util::utos_unit(config->http.response_header_field_buffer) << R"(
3364 << config->http.max_response_header_fields << R"(
3375 << config->http.server_name << R"(
3385 << config->http.redirect_https_port << R"(
3398 << util::utos_unit(config->api.max_request_body) << R"(
3405 << util::duration_str(config->dns.timeout.cache) << R"(
3412 << util::duration_str(config->dns.timeout.lookup) << R"(
3417 << config->dns.max_try << R"(
3498 << util::duration_str(config->quic.upstream.timeout.idle) << R"(
3506 << config->quic.bpf.prog_file << R"(
3528 << (config->quic.upstream.congestion_controller == NGTCP2_CC_ALGO_CUBIC
3568 << util::duration_str(config->quic.upstream.initial_rtt) << R"(
3575 << util::utos_unit(config->http3.upstream.window_size) << R"(
3580 << util::utos_unit(config->http3.upstream.connection_window_size) << R"(
3588 << util::utos_unit(config->http3.upstream.max_window_size) << R"(
3597 << util::utos_unit(config->http3.upstream.max_connection_window_size)
3603 << config->http3.upstream.max_concurrent_streams << R"(
3614 << config->conf_path << R"(
3638 int process_options(Config *config,
3642 if (conf_exists(config->conf_path.c_str())) {
3643 LOG(NOTICE) << "Loading configuration from " << config->conf_path;
3645 if (load_config(config, config->conf_path.c_str(), include_set,
3647 LOG(FATAL) << "Failed to load configuration from " << config->conf_path;
3654 reopen_log_files(config->logging);
3660 if (parse_config(config, p.first, p.second, include_set,
3670 Log::set_severity_level(config->logging.severity);
3672 auto &loggingconf = config->logging;
3679 if (reopen_log_files(config->logging) != 0) {
3686 if (config->uid != 0) {
3688 fchown(log_config()->accesslog_fd, config->uid, config->gid) == -1) {
3694 fchown(log_config()->errorlog_fd, config->uid, config->gid) == -1) {
3701 if (config->single_thread) {
3703 config->num_worker = 1;
3706 auto &http2conf = config->http2;
3722 if (config->uid != 0) {
3723 if (chown(path, config->uid, config->gid) == -1) {
3744 if (config->uid != 0) {
3745 if (chown(path, config->uid, config->gid) == -1) {
3755 auto &tlsconf = config->tls;
3779 auto &listenerconf = config->conn.listener;
3780 auto &upstreamconf = config->conn.upstream;
3799 if (tls::upstream_tls_enabled(config->conn) &&
3807 if (tls::upstream_tls_enabled(config->conn) && !tlsconf.ocsp.disabled) {
3817 if (configure_downstream_group(config, config->http2_proxy, false, tlsconf) !=
3824 auto &proxy = config->downstream_http_proxy;
3880 if (config->rlimit_nofile) {
3881 struct rlimit lim = {static_cast<rlim_t>(config->rlimit_nofile),
3882 static_cast<rlim_t>(config->rlimit_nofile)};
3891 if (config->rlimit_memlock) {
3892 struct rlimit lim = {static_cast<rlim_t>(config->rlimit_memlock),
3893 static_cast<rlim_t>(config->rlimit_memlock)};
3902 auto &fwdconf = config->http.forwarded;
3907 auto iov = make_byte_ref(config->balloc, SHRPX_OBFUSCATED_NODE_LENGTH + 2);
3916 if (config->http2.upstream.debug.frame_debug) {
3925 config->http2.upstream.callbacks = create_http2_upstream_callbacks();
3926 config->http2.downstream.callbacks = create_http2_downstream_callbacks();
3928 if (!config->http.altsvcs.empty()) {
3929 config->http.altsvc_header_value =
3930 http::create_altsvc_header_value(config->balloc, config->http.altsvcs);
3933 if (!config->http.http2_altsvcs.empty()) {
3934 config->http.http2_altsvc_header_value = http::create_altsvc_header_value(
3935 config->balloc, config->http.http2_altsvcs);
3943 // Closes file descriptor which are opened for listeners in config,
3945 void close_not_inherited_fd(Config *config,
3947 auto &listenerconf = config->conn.listener;