mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-06 23:27:04 +02:00
MINOR: log: move log-forwarders cleanup in log.c
Move the log-forwarded proxies cleanup from global deinit() function into log dedicated deinit function. No backport needed.
This commit is contained in:
parent
32f1db6d0d
commit
e187361b52
@ -2805,16 +2805,9 @@ void deinit(void)
|
|||||||
free_proxy(p0);
|
free_proxy(p0);
|
||||||
}/* end while(p) */
|
}/* end while(p) */
|
||||||
|
|
||||||
/* we don't need to free sink_proxies_list proxies since it is
|
/* we don't need to free sink_proxies_list nor cfg_log_forward proxies since
|
||||||
* already handled in sink_deinit()
|
* they are respectively cleaned up in sink_deinit() and deinit_log_forward()
|
||||||
*/
|
*/
|
||||||
p = cfg_log_forward;
|
|
||||||
/* we need to manually clean cfg_log_forward proxy list */
|
|
||||||
while (p) {
|
|
||||||
p0 = p;
|
|
||||||
p = p->next;
|
|
||||||
free_proxy(p0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* destroy all referenced defaults proxies */
|
/* destroy all referenced defaults proxies */
|
||||||
proxy_destroy_all_unref_defaults();
|
proxy_destroy_all_unref_defaults();
|
||||||
|
16
src/log.c
16
src/log.c
@ -1958,6 +1958,20 @@ void deinit_log_buffers()
|
|||||||
logline_rfc5424 = NULL;
|
logline_rfc5424 = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Deinitialize log forwarder proxies used for syslog messages */
|
||||||
|
void deinit_log_forward()
|
||||||
|
{
|
||||||
|
struct proxy *p, *p0;
|
||||||
|
|
||||||
|
p = cfg_log_forward;
|
||||||
|
/* we need to manually clean cfg_log_forward proxy list */
|
||||||
|
while (p) {
|
||||||
|
p0 = p;
|
||||||
|
p = p->next;
|
||||||
|
free_proxy(p0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Builds a log line in <dst> based on <list_format>, and stops before reaching
|
/* Builds a log line in <dst> based on <list_format>, and stops before reaching
|
||||||
* <maxsize> characters. Returns the size of the output string in characters,
|
* <maxsize> characters. Returns the size of the output string in characters,
|
||||||
* not counting the trailing zero which is always added if the resulting size
|
* not counting the trailing zero which is always added if the resulting size
|
||||||
@ -3973,6 +3987,8 @@ REGISTER_CONFIG_SECTION("log-forward", cfg_parse_log_forward, NULL);
|
|||||||
REGISTER_PER_THREAD_ALLOC(init_log_buffers);
|
REGISTER_PER_THREAD_ALLOC(init_log_buffers);
|
||||||
REGISTER_PER_THREAD_FREE(deinit_log_buffers);
|
REGISTER_PER_THREAD_FREE(deinit_log_buffers);
|
||||||
|
|
||||||
|
REGISTER_POST_DEINIT(deinit_log_forward);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Local variables:
|
* Local variables:
|
||||||
* c-indent-level: 8
|
* c-indent-level: 8
|
||||||
|
Loading…
Reference in New Issue
Block a user