void h2_task_destroy(h2_task *task) { if (task->output.beam) { h2_beam_log(task->output.beam, task->c, APLOG_TRACE2, "task_destroy"); h2_beam_destroy(task->output.beam); task->output.beam = NULL; } if (task->eor) { apr_bucket_destroy(task->eor); } if (task->pool) { apr_pool_destroy(task->pool); } }
static apr_status_t stream_pool_cleanup(void *ctx) { h2_stream *stream = ctx; apr_status_t status; if (stream->input) { h2_beam_destroy(stream->input); stream->input = NULL; } if (stream->files) { apr_file_t *file; int i; for (i = 0; i < stream->files->nelts; ++i) { file = APR_ARRAY_IDX(stream->files, i, apr_file_t*); status = apr_file_close(file); ap_log_cerror(APLOG_MARK, APLOG_TRACE3, status, stream->session->c, "h2_stream(%ld-%d): destroy, closed file %d", stream->session->id, stream->id, i); } stream->files = NULL; }