Fix: add missing child_exit hook per architecture.yml
- Add reqin_log_child_exit() to close Unix socket on child exit - Register hook with ap_hook_child_exit() - Ensures clean socket cleanup as specified in architecture.yml Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
@ -606,9 +606,21 @@ static void reqin_log_child_init(apr_pool_t *p, server_rec *s)
|
||||
try_connect(cfg, s);
|
||||
}
|
||||
|
||||
static void reqin_log_child_exit(apr_pool_t *p, server_rec *s)
|
||||
{
|
||||
(void)p;
|
||||
(void)s;
|
||||
|
||||
if (g_child_state.socket_fd >= 0) {
|
||||
close(g_child_state.socket_fd);
|
||||
g_child_state.socket_fd = -1;
|
||||
}
|
||||
}
|
||||
|
||||
static void reqin_log_register_hooks(apr_pool_t *p)
|
||||
{
|
||||
(void)p;
|
||||
ap_hook_post_read_request(reqin_log_post_read_request, NULL, NULL, APR_HOOK_MIDDLE);
|
||||
ap_hook_child_init(reqin_log_child_init, NULL, NULL, APR_HOOK_MIDDLE);
|
||||
ap_hook_child_exit(reqin_log_child_exit, NULL, NULL, APR_HOOK_MIDDLE);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user