Skip to content

Commit d7255a2

Browse files
committed
fix(apache2): correctly clear pool after main pool cleaned
1 parent 86ecec6 commit d7255a2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/mod_redirectionio.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ static int redirectionio_match_handler(request_rec *r) {
109109
}
110110

111111
apr_reslist_timeout_set(config->connection_pool, config->server.timeout * 1000);
112-
apr_pool_cleanup_register(config->pool, config->connection_pool, redirectionio_child_exit, redirectionio_child_exit);
112+
apr_pool_cleanup_register(config->pool, config->connection_pool, redirectionio_child_exit, apr_pool_cleanup_null);
113113
}
114114

115115
// Create context
@@ -659,9 +659,10 @@ static apr_status_t redirectionio_pool_destruct(void* resource, void* params, ap
659659
static apr_status_t redirectionio_child_exit(void *resource) {
660660
apr_reslist_t *connection_pool = (apr_reslist_t *)resource;
661661
apr_pool_t *pool;
662-
apr_pool_create(&pool, NULL);
663662

664-
while (apr_reslist_acquired_count(connection_pool) != 0) {
663+
if (apr_reslist_acquired_count(connection_pool) > 0) {
664+
apr_pool_create(&pool, NULL);
665+
665666
ap_log_perror(APLOG_MARK, APLOG_ERR, 0, pool, "mod_redirectionio: Socket pool not empty: %i", apr_reslist_acquired_count(connection_pool));
666667
}
667668

0 commit comments

Comments
 (0)