*/
struct acl_expr *parse_acl_expr(const char **args);
+/* Purge everything in the acl <acl>, then return <acl>. */
+struct acl *prune_acl(struct acl *acl);
+
/* Parse an ACL with the name starting at <args>[0], and with a list of already
* known ACLs in <acl>. If the ACL was not in the list, it will be added.
* A pointer to that ACL is returned.
*/
int init_pollers();
+/*
+ * Deinitialize the pollers.
+ */
+void deinit_pollers();
+
/*
* Some pollers may lose their connection after a fork(). It may be necessary
* to create initialize part of them again. Returns 0 in case of failure,
int maxqueue; /* maximum number of pending connections allowed */
struct list pendconns; /* pending connections */
struct task *queue_mgt; /* the task associated to the queue processing */
+ struct task *check; /* the task associated to the health check processing */
struct sockaddr_in addr; /* the address to connect to */
struct sockaddr_in source_addr; /* the address to which we want to bind for connect() */
return NULL;
}
+/* Purge everything in the acl <acl>, then return <acl>. */
+struct acl *prune_acl(struct acl *acl) {
+
+ struct acl_expr *expr, *exprb;
+
+ free(acl->name);
+
+ list_for_each_entry_safe(expr, exprb, &acl->expr, list) {
+ LIST_DEL(&expr->list);
+ prune_acl_expr(expr);
+ free(expr);
+ }
+
+ return acl;
+}
+
/* Parse an ACL with the name starting at <args>[0], and with a list of already
* known ACLs in <acl>. If the ACL was not in the list, it will be added.
* A pointer to that ACL is returned.
#include <proto/task.h>
-
+static struct task *appsess_refresh = NULL;
struct pool_head *pool2_appsess;
struct app_pool apools;
int have_appsession;
int appsession_task_init(void)
{
static int initialized = 0;
- struct task *t;
if (!initialized) {
- if ((t = pool_alloc2(pool2_task)) == NULL)
+ if ((appsess_refresh = pool_alloc2(pool2_task)) == NULL)
return -1;
- t->wq = NULL;
- t->qlist.p = NULL;
- t->state = TASK_IDLE;
- t->context = NULL;
- tv_ms_add(&t->expire, &now, TBLCHKINT);
- t->process = appsession_refresh;
- task_queue(t);
+
+ appsess_refresh->wq = NULL;
+ appsess_refresh->qlist.p = NULL;
+ appsess_refresh->state = TASK_IDLE;
+ appsess_refresh->context = NULL;
+ tv_ms_add(&appsess_refresh->expire, &now, TBLCHKINT);
+ appsess_refresh->process = appsession_refresh;
+ task_queue(appsess_refresh);
initialized ++;
}
return 0;
appsession_hash_destroy(&(p->htbl_proxy));
p = p->next;
}
+
+ if (appsess_refresh) {
+ task_delete(appsess_refresh);
+ task_free(appsess_refresh);
+ appsess_refresh = NULL;
+ }
+
}/* end appsession_cleanup() */
return -1;
}
+ s->check = t;
+
t->wq = NULL;
t->qlist.p = NULL;
t->state = TASK_IDLE;
return 0;
}
+/*
+ * Deinitialize the pollers.
+ */
+void deinit_pollers() {
+
+ struct poller *bp;
+ int p;
+
+ for (p = 0; p < nbpollers; p++) {
+ bp = &pollers[p];
+
+ if (bp && bp->pref)
+ bp->term(bp);
+ }
+}
+
/*
* Lists the known pollers on <out>.
* Should be performed only before initialization.
struct listener *l,*l_next;
struct acl_cond *cond, *condb;
struct hdr_exp *exp, *expb;
+ struct acl *acl, *aclb;
int i;
while (p) {
}
/* FIXME: this must also be freed :
- * - ACLs
* - uri_auth (but it's shared)
*/
+ list_for_each_entry_safe(acl, aclb, &p->acl, list) {
+ LIST_DEL(&acl->list);
+ prune_acl(acl);
+ free(acl);
+ }
+
if (p->appsession_name)
free(p->appsession_name);
free(h);
h = h_next;
}/* end while(h) */
-
+
s = p->srv;
while (s) {
s_next = s->next;
+
+ if (s->check) {
+ task_delete(s->check);
+ task_free(s->check);
+ }
+
+ if (s->queue_mgt) {
+ task_delete(s->queue_mgt);
+ task_free(s->queue_mgt);
+ }
+
if (s->id)
free(s->id);
free(s);
s = s_next;
}/* end while(s) */
-
+
l = p->listen;
while (l) {
l_next = l->next;
free(l);
l = l_next;
}/* end while(l) */
-
+
pool_destroy2(p->req_cap_pool);
pool_destroy2(p->rsp_cap_pool);
+ pool_destroy2(p->hdr_idx_pool);
p0 = p;
p = p->next;
free(p0);
if (fdtab) free(fdtab);
fdtab = NULL;
-
+
pool_destroy2(pool2_session);
pool_destroy2(pool2_buffer);
pool_destroy2(pool2_requri);
pool_destroy2(pool2_task);
+ pool_destroy2(pool2_tree64);
pool_destroy2(pool2_capture);
pool_destroy2(pool2_appsess);
pool_destroy2(pool2_pendconn);
pool_destroy2(apools.serverid);
pool_destroy2(apools.sessid);
}
+
+ deinit_pollers();
+
} /* end deinit() */
/* sends the signal <sig> to all pids found in <oldpids> */
*/
#include <common/config.h>
+#include <common/debug.h>
#include <common/memory.h>
#include <common/mini-clist.h>
#include <common/standard.h>
if (flags & entry->flags & MEM_F_SHARED) {
/* we can share this one */
pool = entry;
+ DPRINTF(stderr, "Sharing %s with %s\n", name, pool->name);
break;
}
}