rv = apr_pollset_add(event_pollset, &cs->pfd);
apr_thread_mutex_unlock(timeout_mutex);
if (rv != APR_SUCCESS && !APR_STATUS_IS_EEXIST(rv)) {
- apr_pool_t *p = cs->p;
ap_log_error(APLOG_MARK, APLOG_ERR, rv, ap_server_conf,
"start_lingering_close: apr_pollset_add failure");
apr_thread_mutex_lock(timeout_mutex);
TO_QUEUE_REMOVE(*q, cs);
apr_thread_mutex_unlock(timeout_mutex);
apr_socket_close(cs->pfd.desc.s);
- apr_pool_clear(cs->p);
- ap_push_pool(worker_queue_info, p);
+ ap_push_pool(worker_queue_info, cs->p);
return 0;
}
return 1;
static int start_lingering_close_blocking(event_conn_state_t *cs)
{
if (ap_start_lingering_close(cs->c)) {
- apr_pool_t *p = cs->p;
- apr_pool_clear(cs->p);
- ap_push_pool(worker_queue_info, p);
+ ap_push_pool(worker_queue_info, cs->p);
return 0;
}
return start_lingering_close_common(cs, 1);
|| ap_shutdown_conn(c, 0) != APR_SUCCESS || c->aborted
|| apr_socket_shutdown(csd, APR_SHUTDOWN_WRITE) != APR_SUCCESS) {
apr_socket_close(csd);
- apr_pool_clear(cs->p);
ap_push_pool(worker_queue_info, cs->p);
return 0;
}
{
apr_status_t rv;
apr_socket_t *csd = ap_get_conn_socket(cs->c);
- apr_pool_t *p = cs->p;
ap_log_error(APLOG_MARK, APLOG_TRACE4, 0, ap_server_conf,
"socket reached timeout in lingering-close state");
rv = apr_socket_close(csd);
ap_log_error(APLOG_MARK, APLOG_ERR, rv, ap_server_conf, APLOGNO(00468) "error closing socket");
AP_DEBUG_ASSERT(0);
}
- apr_pool_clear(cs->p);
- ap_push_pool(worker_queue_info, p);
+ ap_push_pool(worker_queue_info, cs->p);
return 0;
}
c = ap_run_create_connection(p, ap_server_conf, sock,
conn_id, sbh, cs->bucket_alloc);
if (!c) {
- apr_bucket_alloc_destroy(cs->bucket_alloc);
- apr_pool_clear(p);
ap_push_pool(worker_queue_info, p);
return;
}
rc = ap_queue_push(worker_queue, cs->pfd.desc.s, cs, cs->p);
if (rc != APR_SUCCESS) {
- apr_pool_t *p = cs->p;
/* trash the connection; we couldn't queue the connected
* socket to a worker
*/
apr_socket_close(cs->pfd.desc.s);
ap_log_error(APLOG_MARK, APLOG_CRIT, rc,
ap_server_conf, APLOGNO(00471) "push2worker: ap_queue_push failed");
- apr_pool_clear(cs->p);
- ap_push_pool(worker_queue_info, p);
+ ap_push_pool(worker_queue_info, cs->p);
}
return rc;
apr_size_t nbytes;
apr_status_t rv;
struct timeout_queue *q;
- apr_pool_t *p = cs->p;
q = (cs->pub.state == CONN_STATE_LINGER_SHORT) ? &short_linger_q : &linger_q;
/* socket is already in non-blocking state */
apr_thread_mutex_unlock(timeout_mutex);
TO_QUEUE_ELEM_INIT(cs);
- apr_pool_clear(cs->p);
- ap_push_pool(worker_queue_info, p);
+ ap_push_pool(worker_queue_info, cs->p);
}
/* call 'func' for all elements of 'q' with timeout less than 'timeout_time'.
ap_log_error(APLOG_MARK, APLOG_CRIT, rc,
ap_server_conf,
"ap_queue_push failed");
- apr_pool_clear(ptrans);
ap_push_pool(worker_queue_info, ptrans);
}
else {
}
}
else {
- apr_pool_clear(ptrans);
ap_push_pool(worker_queue_info, ptrans);
}
}
apr_atomic_inc32(&queue_info->recycled_pools_count);
}
+ apr_pool_clear(pool_to_recycle);
new_recycle = (struct recycled_pool *) apr_palloc(pool_to_recycle,
sizeof (*new_recycle));
new_recycle->pool = pool_to_recycle;
rv = apr_pollset_add(event_pollset, &op->cs->pfd);
if (rv != APR_SUCCESS && !APR_STATUS_IS_EEXIST(rv)) {
- apr_pool_t *p = cs->p;
ap_log_error(APLOG_MARK, APLOG_ERR, rv, ap_server_conf, APLOGNO(00467)
"%s: apr_pollset_add failure", op->tag);
apr_socket_close(cs->pfd.desc.s);
- apr_pool_clear(cs->p);
- ap_push_pool(worker_queue_info, p);
+ ap_push_pool(worker_queue_info, cs->p);
return 0;
}
return 1;
static int start_lingering_close_blocking(event_conn_state_t *cs, ap_equeue_t *eq)
{
if (ap_start_lingering_close(cs->c)) {
- apr_pool_t *p = cs->p;
- apr_pool_clear(cs->p);
- ap_push_pool(worker_queue_info, p);
+ ap_push_pool(worker_queue_info, cs->p);
return 0;
}
return start_lingering_close(cs, eq);
if (c->aborted
|| ap_shutdown_conn(c, 0) != APR_SUCCESS || c->aborted
|| apr_socket_shutdown(csd, APR_SHUTDOWN_WRITE) != APR_SUCCESS) {
- apr_pool_t *p = cs->p;
apr_socket_close(csd);
- apr_pool_clear(cs->p);
- ap_push_pool(worker_queue_info, p);
+ ap_push_pool(worker_queue_info, cs->p);
return 0;
}
return start_lingering_close(cs, eq);
{
apr_status_t rv;
apr_socket_t *csd = ap_get_conn_socket(cs->c);
- apr_pool_t *p = cs->p;
ap_log_error(APLOG_MARK, APLOG_TRACE4, 0, ap_server_conf,
"socket reached timeout in lingering-close state");
rv = apr_socket_close(csd);
ap_log_error(APLOG_MARK, APLOG_ERR, rv, ap_server_conf, APLOGNO(00468) "error closing socket");
AP_DEBUG_ASSERT(0);
}
- apr_pool_clear(cs->p);
- ap_push_pool(worker_queue_info, p);
+ ap_push_pool(worker_queue_info, cs->p);
return 0;
}
c = ap_run_create_connection(p, ap_server_conf, sock,
conn_id, sbh, cs->bucket_alloc);
if (!c) {
- apr_bucket_alloc_destroy(cs->bucket_alloc);
- apr_pool_clear(p);
ap_push_pool(worker_queue_info, p);
return;
}
rc = ap_queue_push(worker_queue, cs->pfd.desc.s, cs, cs->p);
if (rc != APR_SUCCESS) {
- apr_pool_t *p = cs->p;
/* trash the connection; we couldn't queue the connected
* socket to a worker
*/
apr_socket_close(cs->pfd.desc.s);
ap_log_error(APLOG_MARK, APLOG_CRIT, rc,
ap_server_conf, APLOGNO(00471) "push2worker: ap_queue_push failed");
- apr_pool_clear(cs->p);
- ap_push_pool(worker_queue_info, p);
+ ap_push_pool(worker_queue_info, cs->p);
}
return rc;
apr_size_t nbytes;
apr_status_t rv;
struct timeout_queue *q;
- apr_pool_t *p = cs->p;
q = (cs->pub.state == CONN_STATE_LINGER_SHORT) ? &short_linger_q : &linger_q;
/* socket is already in non-blocking state */
TO_QUEUE_REMOVE(*q, cs);
TO_QUEUE_ELEM_INIT(cs);
- apr_pool_clear(cs->p);
- ap_push_pool(worker_queue_info, p);
+ ap_push_pool(worker_queue_info, cs->p);
}
/* call 'func' for all elements of 'q' with timeout less than 'timeout_time'.
ap_log_error(APLOG_MARK, APLOG_CRIT, rc,
ap_server_conf,
"ap_queue_push failed");
- apr_pool_clear(ptrans);
ap_push_pool(worker_queue_info, ptrans);
}
else {
}
}
else {
- apr_pool_clear(ptrans);
ap_push_pool(worker_queue_info, ptrans);
}
}
apr_atomic_inc32(&queue_info->recycled_pools_count);
}
+ apr_pool_clear(pool_to_recycle);
new_recycle = (struct recycled_pool *) apr_palloc(pool_to_recycle,
sizeof (*new_recycle));
new_recycle->pool = pool_to_recycle;