| 1544 | } |
| 1545 | |
| 1546 | static apr_pool_t *make_conn_subpool(apr_pool_t *p, const char *tag, |
| 1547 | server_rec *s) |
| 1548 | { |
| 1549 | apr_pool_t *sp = NULL; |
| 1550 | apr_allocator_t *alloc; |
| 1551 | apr_thread_mutex_t *mutex; |
| 1552 | apr_status_t rv; |
| 1553 | |
| 1554 | rv = apr_allocator_create(&alloc); |
| 1555 | if (rv == APR_SUCCESS) { |
| 1556 | rv = apr_thread_mutex_create(&mutex, APR_THREAD_MUTEX_DEFAULT, p); |
| 1557 | if (rv == APR_SUCCESS) { |
| 1558 | apr_allocator_mutex_set(alloc, mutex); |
| 1559 | apr_allocator_max_free_set(alloc, ap_max_mem_free); |
| 1560 | rv = apr_pool_create_ex(&sp, p, NULL, alloc); |
| 1561 | } |
| 1562 | else { |
| 1563 | apr_allocator_destroy(alloc); |
| 1564 | } |
| 1565 | } |
| 1566 | if (rv != APR_SUCCESS) { |
| 1567 | ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s, APLOGNO(10474) |
| 1568 | "failed to create %s pool", tag); |
| 1569 | ap_abort_on_oom(); |
| 1570 | return NULL; /* not reached */ |
| 1571 | } |
| 1572 | apr_allocator_owner_set(alloc, sp); |
| 1573 | apr_pool_tag(sp, tag); |
| 1574 | |
| 1575 | return sp; |
| 1576 | } |
| 1577 | |
| 1578 | static void init_conn_pool(apr_pool_t *p, proxy_worker *worker, server_rec *s) |
| 1579 | { |
no test coverage detected