From 466e4b7a1e171b7b183922b7e8a27a61ca3a293d Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 14 Feb 2016 22:20:10 +0900 Subject: [PATCH] nghttpx: Use ImmutableString for conf_path --- src/shrpx.cc | 12 ++++++------ src/shrpx_config.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/shrpx.cc b/src/shrpx.cc index 8508da4d..0c1fb3f7 100644 --- a/src/shrpx.cc +++ b/src/shrpx.cc @@ -1040,7 +1040,7 @@ void fill_default_config() { *mod_config() = {}; mod_config()->num_worker = 1; - mod_config()->conf_path = strcopy("/etc/nghttpx/nghttpx.conf"); + mod_config()->conf_path = "/etc/nghttpx/nghttpx.conf"; mod_config()->pid = getpid(); auto &tlsconf = mod_config()->tls; @@ -1893,7 +1893,7 @@ Scripting: Misc: --conf= Load configuration from . - Default: )" << get_config()->conf_path.get() << R"( + Default: )" << get_config()->conf_path << R"( --include= Load additional configurations from . File is read when configuration parser encountered this @@ -1919,11 +1919,11 @@ namespace { void process_options( int argc, char **argv, std::vector> &cmdcfgs) { - if (conf_exists(get_config()->conf_path.get())) { + if (conf_exists(get_config()->conf_path.c_str())) { std::set include_set; - if (load_config(get_config()->conf_path.get(), include_set) == -1) { + if (load_config(get_config()->conf_path.c_str(), include_set) == -1) { LOG(FATAL) << "Failed to load configuration from " - << get_config()->conf_path.get(); + << get_config()->conf_path; exit(EXIT_FAILURE); } assert(include_set.empty()); @@ -2563,7 +2563,7 @@ int main(int argc, char **argv) { break; case 12: // --conf - mod_config()->conf_path = strcopy(optarg); + mod_config()->conf_path = optarg; break; case 14: // --syslog-facility diff --git a/src/shrpx_config.h b/src/shrpx_config.h index 3caa7aeb..c7a3ef59 100644 --- a/src/shrpx_config.h +++ b/src/shrpx_config.h @@ -582,7 +582,7 @@ struct Config { LoggingConfig logging; ConnectionConfig conn; ImmutableString pid_file; - std::unique_ptr conf_path; + ImmutableString conf_path; std::unique_ptr user; std::unique_ptr mruby_file; char **original_argv;