REORG: move init_default_instance() to proxy.c and pass it the defproxy pointer
init_default_instance() was still left in cfgparse.c which is not the
best place to pre-initialize a proxy. Let's place it in proxy.c just
after init_new_proxy(), take this opportunity for renaming it to
proxy_preset_defaults() and taking out init_new_proxy() from it, and
let's pass it the pointer to the default proxy to be initialized instead
of implicitly assuming defproxy. We'll soon be able to exploit this.
Only two call places had to be updated.
diff --git a/src/cfgparse-listen.c b/src/cfgparse-listen.c
index 80b845a..cdc3f5b 100644
--- a/src/cfgparse-listen.c
+++ b/src/cfgparse-listen.c
@@ -526,7 +526,8 @@
deinit_proxy_tcpcheck(&defproxy);
/* we cannot free uri_auth because it might already be used */
- init_default_instance();
+ init_new_proxy(&defproxy);
+ proxy_preset_defaults(&defproxy);
curproxy = &defproxy;
curproxy->conf.args.file = curproxy->conf.file = strdup(file);
curproxy->conf.args.line = curproxy->conf.line = linenum;