Commit 96ff3be5 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

nghttpx: Use allocator of new config since this may happen multiple times

parent 3d5d76ba
...@@ -806,7 +806,8 @@ namespace { ...@@ -806,7 +806,8 @@ namespace {
// Returns array of InheritedAddr constructed from |config|. This // Returns array of InheritedAddr constructed from |config|. This
// function is intended to be used when reloading configuration, and // function is intended to be used when reloading configuration, and
// |config| is usually a current configuration. // |config| is usually a current configuration.
std::vector<InheritedAddr> get_inherited_addr_from_config(Config *config) { std::vector<InheritedAddr>
get_inherited_addr_from_config(BlockAllocator &balloc, Config *config) {
int rv; int rv;
auto &listenerconf = config->conn.listener; auto &listenerconf = config->conn.listener;
...@@ -856,7 +857,7 @@ std::vector<InheritedAddr> get_inherited_addr_from_config(Config *config) { ...@@ -856,7 +857,7 @@ std::vector<InheritedAddr> get_inherited_addr_from_config(Config *config) {
continue; continue;
} }
iaddr.host = make_string_ref(config->balloc, StringRef{host.data()}); iaddr.host = make_string_ref(balloc, StringRef{host.data()});
} }
return iaddrs; return iaddrs;
...@@ -2637,7 +2638,7 @@ void reload_config(WorkerProcess *wp) { ...@@ -2637,7 +2638,7 @@ void reload_config(WorkerProcess *wp) {
return; return;
} }
auto iaddrs = get_inherited_addr_from_config(cur_config); auto iaddrs = get_inherited_addr_from_config(new_config->balloc, cur_config);
if (create_acceptor_socket(new_config.get(), iaddrs) != 0) { if (create_acceptor_socket(new_config.get(), iaddrs) != 0) {
close_not_inherited_fd(new_config.get(), iaddrs); close_not_inherited_fd(new_config.get(), iaddrs);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment