}
/* Structures to reuse */
-static APR_RING_HEAD(timer_free_ring_t, timer_event_t) timer_free_ring;
+static timer_event_t timer_free_ring;
static apr_skiplist *timer_skiplist;
static volatile apr_time_t timers_next_expiry;
/* oh yeah, and make locking smarter/fine grained. */
apr_thread_mutex_lock(g_timer_skiplist_mtx);
- if (!APR_RING_EMPTY(&timer_free_ring, timer_event_t, link)) {
- te = APR_RING_FIRST(&timer_free_ring);
+ if (!APR_RING_EMPTY(&timer_free_ring.link, timer_event_t, link)) {
+ te = APR_RING_FIRST(&timer_free_ring.link);
APR_RING_REMOVE(te, link);
}
else {
{
apr_uint32_t total = 0, count;
event_conn_state_t *first, *cs, *last;
- struct timeout_head_t trash;
+ struct event_conn_state_t trash;
struct timeout_queue *qp;
apr_status_t rv;
return;
}
- APR_RING_INIT(&trash, event_conn_state_t, timeout_list);
+ APR_RING_INIT(&trash.timeout_list, event_conn_state_t, timeout_list);
for (qp = q; qp; qp = qp->next) {
count = 0;
cs = first = last = APR_RING_FIRST(&qp->head);
continue;
APR_RING_UNSPLICE(first, last, timeout_list);
- APR_RING_SPLICE_TAIL(&trash, first, last, event_conn_state_t,
+ APR_RING_SPLICE_TAIL(&trash.timeout_list, first, last, event_conn_state_t,
timeout_list);
AP_DEBUG_ASSERT(*q->total >= count && qp->count >= count);
*q->total -= count;
return;
apr_thread_mutex_unlock(timeout_mutex);
- first = APR_RING_FIRST(&trash);
+ first = APR_RING_FIRST(&trash.timeout_list);
do {
cs = APR_RING_NEXT(first, timeout_list);
TO_QUEUE_ELEM_INIT(first);
{
apr_thread_mutex_lock(g_timer_skiplist_mtx);
- APR_RING_INSERT_TAIL(&timer_free_ring, te, timer_event_t, link);
+ APR_RING_INSERT_TAIL(&timer_free_ring.link, te, timer_event_t, link);
apr_thread_mutex_unlock(g_timer_skiplist_mtx);
}
}
apr_pool_create(&pskip, pconf);
apr_pool_tag(pskip, "mpm_skiplist");
apr_thread_mutex_create(&g_timer_skiplist_mtx, APR_THREAD_MUTEX_DEFAULT, pskip);
- APR_RING_INIT(&timer_free_ring, timer_event_t, link);
+ APR_RING_INIT(&timer_free_ring.link, timer_event_t, link);
apr_skiplist_init(&timer_skiplist, pskip);
apr_skiplist_set_compare(timer_skiplist, timer_comp, timer_comp);
static apr_file_t *outfile; /* stdout file handle */
static apr_off_t unsolicited; /* file size summary for deleted unsolicited
files */
-static APR_RING_ENTRY(_entry) root; /* ENTRY ring anchor */
+static ENTRY root; /* ENTRY ring anchor */
/* short program name as called */
static const char *shortname = "htcacheclean";
apr_size_t len;
apr_time_t current, deviation;
char *nextpath, *base, *ext;
- APR_RING_ENTRY(_direntry) anchor;
- DIRENTRY *d, *t, *n;
+ DIRENTRY *d, *t, *n, anchor;
ENTRY *e;
int skip, retries;
disk_cache_info_t disk_info;
- APR_RING_INIT(&anchor, _direntry, link);
+ APR_RING_INIT(&anchor.link, _direntry, link);
apr_pool_create(&p, pool);
h = apr_hash_make(p);
fd = NULL;
}
d = apr_pcalloc(p, sizeof(DIRENTRY));
d->basename = apr_pstrcat(p, path, "/", info.name, NULL);
- APR_RING_INSERT_TAIL(&anchor, d, _direntry, link);
+ APR_RING_INSERT_TAIL(&anchor.link, d, _direntry, link);
(*nodes)++;
}
skip = baselen + 1;
- for (d = APR_RING_FIRST(&anchor);
- !interrupted && d != APR_RING_SENTINEL(&anchor, _direntry, link);
+ for (d = APR_RING_FIRST(&anchor.link);
+ !interrupted && d != APR_RING_SENTINEL(&anchor.link, _direntry, link);
d=n) {
n = APR_RING_NEXT(d, link);
base = strrchr(d->basename, '/');
&len) == APR_SUCCESS) {
apr_file_close(fd);
e = apr_palloc(pool, sizeof(ENTRY));
- APR_RING_INSERT_TAIL(&root, e, _entry, link);
+ APR_RING_INSERT_TAIL(&root.link, e, _entry, link);
e->expire = disk_info.expire;
e->response_time = disk_info.response_time;
e->htime = d->htime;
&len) == APR_SUCCESS) {
apr_file_close(fd);
e = apr_palloc(pool, sizeof(ENTRY));
- APR_RING_INSERT_TAIL(&root, e, _entry, link);
+ APR_RING_INSERT_TAIL(&root.link, e, _entry, link);
e->expire = disk_info.expire;
e->response_time = disk_info.response_time;
e->htime = d->htime;
s.inodes = inodes;
s.ntotal = nodes;
- for (e = APR_RING_FIRST(&root);
- e != APR_RING_SENTINEL(&root, _entry, link);
+ for (e = APR_RING_FIRST(&root.link);
+ e != APR_RING_SENTINEL(&root.link, _entry, link);
e = APR_RING_NEXT(e, link)) {
s.sum += round_up((apr_size_t)e->hsize, round);
s.sum += round_up((apr_size_t)e->dsize, round);
* happen if a wrong system time is corrected
*/
- for (e = APR_RING_FIRST(&root);
- e != APR_RING_SENTINEL(&root, _entry, link) && !interrupted;) {
+ for (e = APR_RING_FIRST(&root.link);
+ e != APR_RING_SENTINEL(&root.link, _entry, link) && !interrupted;) {
n = APR_RING_NEXT(e, link);
if (e->response_time > now || e->htime > now || e->dtime > now) {
delete_entry(path, e->basename, &s.nodes, pool);
}
/* process all entries which are expired */
- for (e = APR_RING_FIRST(&root);
- e != APR_RING_SENTINEL(&root, _entry, link) && !interrupted;) {
+ for (e = APR_RING_FIRST(&root.link);
+ e != APR_RING_SENTINEL(&root.link, _entry, link) && !interrupted;) {
n = APR_RING_NEXT(e, link);
if (e->expire != APR_DATE_BAD && e->expire < now) {
delete_entry(path, e->basename, &s.nodes, pool);
* than sorry
*/
while (!((!s.max || s.sum <= s.max) && (!s.inodes || s.nodes <= s.inodes))
- && !interrupted && !APR_RING_EMPTY(&root, _entry, link)) {
- oldest = APR_RING_FIRST(&root);
+ && !interrupted && !APR_RING_EMPTY(&root.link, _entry, link)) {
+ oldest = APR_RING_FIRST(&root.link);
for (e = APR_RING_NEXT(oldest, link);
- e != APR_RING_SENTINEL(&root, _entry, link);
+ e != APR_RING_SENTINEL(&root.link, _entry, link);
e = APR_RING_NEXT(e, link)) {
if (e->dtime < oldest->dtime) {
oldest = e;
apr_pool_create(&instance, pool);
now = apr_time_now();
- APR_RING_INIT(&root, _entry, link);
+ APR_RING_INIT(&root.link, _entry, link);
delcount = 0;
unsolicited = 0;
dowork = 0;