while (*(args[cur_arg])) {
name = calloc(1, sizeof(*name));
name->name = strdup(args[cur_arg]);
- LIST_ADDQ(&global_51degrees.property_names, &name->list);
+ LIST_APPEND(&global_51degrees.property_names, &name->list);
++cur_arg;
}
ha_free(&global_51degrees.data_file_path);
list_for_each_entry_safe(_51d_prop_name, _51d_prop_nameb, &global_51degrees.property_names, list) {
- LIST_DEL(&_51d_prop_name->list);
+ LIST_DELETE(&_51d_prop_name->list);
free(_51d_prop_name);
}
#define FLT_OT_RUN_ONCE(f) do { static bool __f = 1; if (__f) { __f = 0; f; } } while (0)
#define FLT_OT_LIST_ISVALID(a) (((a) != NULL) && ((a)->n != NULL) && ((a)->p != NULL))
-#define FLT_OT_LIST_DEL(a) do { if (FLT_OT_LIST_ISVALID(a)) LIST_DEL(a); } while (0)
+#define FLT_OT_LIST_DEL(a) do { if (FLT_OT_LIST_ISVALID(a)) LIST_DELETE(a); } while (0)
#define FLT_OT_LIST_DESTROY(t,h) \
do { \
struct flt_ot_conf_##t *_ptr, *_back; \
retptr->cfg_line = linenum;
if (head != NULL)
- LIST_ADDQ(head, &(retptr->list));
+ LIST_APPEND(head, &(retptr->list));
} else {
FLT_OT_ERR("out of memory");
}
}
FLT_OT_DBG(2, "- deleting proxy_log.logsrvs list %s", flt_ot_list_debug(&((*ptr)->proxy_log.logsrvs)));
list_for_each_entry_safe(logsrv, logsrvback, &((*ptr)->proxy_log.logsrvs), list) {
- LIST_DEL(&(logsrv->list));
+ LIST_DELETE(&(logsrv->list));
FLT_OT_FREE(logsrv);
}
FLT_OT_LIST_DESTROY(ph_group, &((*ptr)->ph_groups));
retptr->ref_type = ref_type;
retptr->ref_span = ref_span;
retptr->ref_ctx = ref_ctx;
- LIST_ADD(&(rt_ctx->spans), &(retptr->list));
+ LIST_INSERT(&(rt_ctx->spans), &(retptr->list));
FLT_OT_DBG_SCOPE_SPAN("new span ", retptr);
retptr->id_len = id_len;
retptr->smp_opt_dir = dir;
retptr->context = span_ctx;
- LIST_ADD(&(rt_ctx->contexts), &(retptr->list));
+ LIST_INSERT(&(rt_ctx->contexts), &(retptr->list));
FLT_OT_DBG_SCOPE_CONTEXT("new context ", retptr);
wi->data.name = strdup(args[argIdx]);
wi->data.type = HA_WURFL_DATA_TYPE_UNKNOWN;
wi->data.func_callback = NULL;
- LIST_ADDQ(&global_wurfl.information_list, &wi->list);
+ LIST_APPEND(&global_wurfl.information_list, &wi->list);
++argIdx;
}
}
wp->patch_file_path = strdup(args[argIdx]);
- LIST_ADDQ(&global_wurfl.patch_file_list, &wp->list);
+ LIST_APPEND(&global_wurfl.patch_file_list, &wp->list);
++argIdx;
}
ha_free(&global_wurfl.cache_size);
list_for_each_entry_safe(wi, wi2, &global_wurfl.information_list, list) {
- LIST_DEL(&wi->list);
+ LIST_DELETE(&wi->list);
free(wi);
}
list_for_each_entry_safe(wp, wp2, &global_wurfl.patch_file_list, list) {
- LIST_DEL(&wp->list);
+ LIST_DELETE(&wp->list);
free(wp);
}
#define LIST_HEAD_INIT(l) { &l, &l }
/* adds an element at the beginning of a list ; returns the element */
-#define LIST_ADD(lh, el) ({ (el)->n = (lh)->n; (el)->n->p = (lh)->n = (el); (el)->p = (lh); (el); })
+#define LIST_INSERT(lh, el) ({ (el)->n = (lh)->n; (el)->n->p = (lh)->n = (el); (el)->p = (lh); (el); })
/* adds an element at the end of a list ; returns the element */
-#define LIST_ADDQ(lh, el) ({ (el)->p = (lh)->p; (el)->p->n = (lh)->p = (el); (el)->n = (lh); (el); })
+#define LIST_APPEND(lh, el) ({ (el)->p = (lh)->p; (el)->p->n = (lh)->p = (el); (el)->n = (lh); (el); })
/* adds the contents of a list <old> at the beginning of another list <new>. The old list head remains untouched. */
#define LIST_SPLICE(new, old) do { \
} while (0)
/* removes an element from a list and returns it */
-#define LIST_DEL(el) ({ typeof(el) __ret = (el); (el)->n->p = (el)->p; (el)->p->n = (el)->n; (__ret); })
+#define LIST_DELETE(el) ({ typeof(el) __ret = (el); (el)->n->p = (el)->p; (el)->p->n = (el)->n; (__ret); })
/* removes an element from a list, initializes it and returns it.
- * This is faster than LIST_DEL+LIST_INIT as we avoid reloading the pointers.
+ * This is faster than LIST_DELETE+LIST_INIT as we avoid reloading the pointers.
*/
#define LIST_DEL_INIT(el) ({ \
typeof(el) __ret = (el); \
/* checks if the list element <el> was added to a list or not. This only
* works when detached elements are reinitialized (using LIST_DEL_INIT)
*/
-#define LIST_ADDED(el) ((el)->n != (el))
+#define LIST_INLIST(el) ((el)->n != (el))
/* returns a pointer of type <pt> to a structure following the element
* which contains list head <lh>, which is known as element <el> in
* Returns 1 if we added the item, 0 otherwise (because it was already in a
* list).
*/
-#define MT_LIST_TRY_ADD(_lh, _el) \
+#define MT_LIST_TRY_INSERT(_lh, _el) \
({ \
int _ret = 0; \
struct mt_list *lh = (_lh), *el = (_el); \
* Returns 1 if we added the item, 0 otherwise (because it was already in a
* list).
*/
-#define MT_LIST_TRY_ADDQ(_lh, _el) \
+#define MT_LIST_TRY_APPEND(_lh, _el) \
({ \
int _ret = 0; \
struct mt_list *lh = (_lh), *el = (_el); \
* Add an item at the beginning of a list.
* It is assumed the element can't already be in a list, so it isn't checked.
*/
-#define MT_LIST_ADD(_lh, _el) \
+#define MT_LIST_INSERT(_lh, _el) \
({ \
int _ret = 0; \
struct mt_list *lh = (_lh), *el = (_el); \
* Add an item at the end of a list.
* It is assumed the element can't already be in a list, so it isn't checked
*/
-#define MT_LIST_ADDQ(_lh, _el) \
+#define MT_LIST_APPEND(_lh, _el) \
({ \
int _ret = 0; \
struct mt_list *lh = (_lh), *el = (_el); \
/*
* Detach a list from its head. A pointer to the first element is returned
* and the list is closed. If the list was empty, NULL is returned. This may
- * exclusively be used with lists modified by MT_LIST_TRY_ADD/MT_LIST_TRY_ADDQ. This
- * is incompatible with MT_LIST_DEL run concurrently.
+ * exclusively be used with lists modified by MT_LIST_TRY_INSERT/MT_LIST_TRY_APPEND. This
+ * is incompatible with MT_LIST_DELETE run concurrently.
* If there's at least one element, the next of the last element will always
* be NULL.
*/
/* Remove an item from a list.
* Returns 1 if we removed the item, 0 otherwise (because it was in no list).
*/
-#define MT_LIST_DEL(_el) \
+#define MT_LIST_DELETE(_el) \
({ \
int _ret = 0; \
struct mt_list *el = (_el); \
/* checks if the list element <el> was added to a list or not. This only
* works when detached elements are reinitialized (using LIST_DEL_INIT)
*/
-#define MT_LIST_ADDED(el) ((el)->next != (el))
+#define MT_LIST_INLIST(el) ((el)->next != (el))
/* Lock an element in the list, to be sure it won't be removed.
* It needs to be synchronized somehow to be sure it's not removed
p->next = n; \
} while (0);
-/* Equivalent of MT_LIST_DEL(), to be used when parsing the list with mt_list_entry_for_each_safe().
+/* Equivalent of MT_LIST_DELETE(), to be used when parsing the list with mt_list_entry_for_each_safe().
* It should be the element currently parsed (tmpelt1)
*/
-#define MT_LIST_DEL_SAFE(_el) \
+#define MT_LIST_DELETE_SAFE(_el) \
do { \
struct mt_list *el = (_el); \
(el)->prev = (el); \
(_el) = NULL; \
} while (0)
-/* Safe as MT_LIST_DEL_SAFE, but it won't reinit the element */
-#define MT_LIST_DEL_SAFE_NOINIT(_el) \
+/* Safe as MT_LIST_DELETE_SAFE, but it won't reinit the element */
+#define MT_LIST_DELETE_SAFE_NOINIT(_el) \
do { \
(_el) = NULL; \
} while (0)
* the list is passed in <list_head>. A temporary variable <back> of same type
* as <item> is needed so that <item> may safely be deleted if needed.
* tmpelt1 is a temporary struct mt_list *, and tmpelt2 is a temporary
- * struct mt_list, used internally, both are needed for MT_LIST_DEL_SAFE.
+ * struct mt_list, used internally, both are needed for MT_LIST_DELETE_SAFE.
* Example: list_for_each_entry_safe(cur_acl, tmp, known_acl, list, elt1, elt2)
* { ... };
- * If you want to remove the current element, please use MT_LIST_DEL_SAFE.
+ * If you want to remove the current element, please use MT_LIST_DELETE_SAFE.
*/
#define mt_list_for_each_entry_safe(item, list_head, member, tmpelt, tmpelt2) \
for ((tmpelt) = NULL; (tmpelt) != MT_LIST_BUSY; ({ \
event_del(&frame->process_frame_event);
worker = frame->worker;
- LIST_DEL(&frame->list);
+ LIST_DELETE(&frame->list);
if (frame->frag_buf)
free(frame->frag_buf);
memset(frame, 0, sizeof(*frame)+max_frame_size+4);
- LIST_ADDQ(&worker->frames, &frame->list);
+ LIST_APPEND(&worker->frames, &frame->list);
}
static void
DEBUG(c->worker, "<%lu> Release client", c->id);
- LIST_DEL(&c->by_worker);
+ LIST_DELETE(&c->by_worker);
c->worker->nbclients--;
unuse_spoe_engine(c);
LIST_INIT(&eng->clients);
LIST_INIT(&eng->processing_frames);
LIST_INIT(&eng->outgoing_frames);
- LIST_ADDQ(&client->worker->engines, &eng->list);
+ LIST_APPEND(&client->worker->engines, &eng->list);
LOG(client->worker, "Add new SPOE engine '%s'", eng->id);
end:
client->engine = eng;
- LIST_ADDQ(&eng->clients, &client->by_engine);
+ LIST_APPEND(&eng->clients, &client->by_engine);
}
static void
eng = client->engine;
client->engine = NULL;
- LIST_DEL(&client->by_engine);
+ LIST_DELETE(&client->by_engine);
if (!LIST_ISEMPTY(&eng->clients))
return;
LOG(client->worker, "Remove SPOE engine '%s'", eng->id);
- LIST_DEL(&eng->list);
+ LIST_DELETE(&eng->list);
list_for_each_entry_safe(frame, back, &eng->processing_frames, list) {
release_frame(frame);
}
else {
frame = LIST_NEXT(&client->worker->frames, typeof(frame), list);
- LIST_DEL(&frame->list);
+ LIST_DELETE(&frame->list);
}
reset_frame(frame);
frame = client->outgoing_frame;
else if (!LIST_ISEMPTY(&client->outgoing_frames)) {
frame = LIST_NEXT(&client->outgoing_frames, typeof(frame), list);
- LIST_DEL(&frame->list);
+ LIST_DELETE(&frame->list);
client->outgoing_frame = frame;
}
else if (engine!= NULL && !LIST_ISEMPTY(&engine->outgoing_frames)) {
frame = LIST_NEXT(&engine->outgoing_frames, typeof(frame), list);
- LIST_DEL(&frame->list);
+ LIST_DELETE(&frame->list);
client->outgoing_frame = frame;
}
return frame;
{
uint32_t netint;
- LIST_DEL(&frame->list);
+ LIST_DELETE(&frame->list);
frame->buf = (char *)(frame->data);
frame->offset = 0;
if (client->outgoing_frame == NULL)
client->outgoing_frame = frame;
else
- LIST_ADD(&client->outgoing_frames, &frame->list);
+ LIST_INSERT(&client->outgoing_frames, &frame->list);
}
else {
client->outgoing_frame = frame;
}
else { /* for all other frames */
if (frame->client == NULL) { /* async mode ! */
- LIST_ADDQ(&frame->engine->outgoing_frames, &frame->list);
+ LIST_APPEND(&frame->engine->outgoing_frames, &frame->list);
list_for_each_entry(client, &frame->engine->clients, by_engine)
event_add(&client->write_frame_event, NULL);
}
else if (frame->client->pipelining) {
- LIST_ADDQ(&frame->client->outgoing_frames, &frame->list);
+ LIST_APPEND(&frame->client->outgoing_frames, &frame->list);
event_add(&frame->client->write_frame_event, NULL);
}
else {
if (client->async) {
frame->client = NULL;
- LIST_ADDQ(&frame->engine->processing_frames, &frame->list);
+ LIST_APPEND(&frame->engine->processing_frames, &frame->list);
}
else if (client->pipelining)
- LIST_ADDQ(&client->processing_frames, &frame->list);
+ LIST_APPEND(&client->processing_frames, &frame->list);
else
event_del(&client->read_frame_event);
}
LIST_INIT(&client->processing_frames);
LIST_INIT(&client->outgoing_frames);
- LIST_ADDQ(&worker->clients, &client->by_worker);
+ LIST_APPEND(&worker->clients, &client->by_worker);
worker->nbclients++;
}
list_for_each_entry_safe(frame, fback, &worker->frames, list) {
- LIST_DEL(&frame->list);
+ LIST_DELETE(&frame->list);
free(frame);
}
#define LIST_HEAD_INIT(l) { &l, &l }
/* adds an element at the beginning of a list ; returns the element */
-#define LIST_ADD(lh, el) ({ (el)->n = (lh)->n; (el)->n->p = (lh)->n = (el); (el)->p = (lh); (el); })
+#define LIST_INSERT(lh, el) ({ (el)->n = (lh)->n; (el)->n->p = (lh)->n = (el); (el)->p = (lh); (el); })
/* adds an element at the end of a list ; returns the element */
-#define LIST_ADDQ(lh, el) ({ (el)->p = (lh)->p; (el)->p->n = (lh)->p = (el); (el)->n = (lh); (el); })
+#define LIST_APPEND(lh, el) ({ (el)->p = (lh)->p; (el)->p->n = (lh)->p = (el); (el)->n = (lh); (el); })
/* adds the contents of a list <old> at the beginning of another list <new>. The old list head remains untouched. */
#define LIST_SPLICE(new, old) do { \
} while (0)
/* removes an element from a list and returns it */
-#define LIST_DEL(el) ({ typeof(el) __ret = (el); (el)->n->p = (el)->p; (el)->p->n = (el)->n; (__ret); })
+#define LIST_DELETE(el) ({ typeof(el) __ret = (el); (el)->n->p = (el)->p; (el)->p->n = (el)->n; (__ret); })
/* removes an element from a list, initializes it and returns it.
- * This is faster than LIST_DEL+LIST_INIT as we avoid reloading the pointers.
+ * This is faster than LIST_DELETE+LIST_INIT as we avoid reloading the pointers.
*/
#define LIST_DEL_INIT(el) ({ \
typeof(el) __ret = (el); \
/* checks if the list element <el> was added to a list or not. This only
* works when detached elements are reinitialized (using LIST_DEL_INIT)
*/
-#define LIST_ADDED(el) ((el)->n != (el))
+#define LIST_INLIST(el) ((el)->n != (el))
/* returns a pointer of type <pt> to a structure following the element
* which contains list head <lh>, which is known as element <el> in
* Returns 1 if we added the item, 0 otherwise (because it was already in a
* list).
*/
-#define MT_LIST_TRY_ADD(_lh, _el) \
+#define MT_LIST_TRY_INSERT(_lh, _el) \
({ \
int _ret = 0; \
struct mt_list *lh = (_lh), *el = (_el); \
* Returns 1 if we added the item, 0 otherwise (because it was already in a
* list).
*/
-#define MT_LIST_TRY_ADDQ(_lh, _el) \
+#define MT_LIST_TRY_APPEND(_lh, _el) \
({ \
int _ret = 0; \
struct mt_list *lh = (_lh), *el = (_el); \
* Add an item at the beginning of a list.
* It is assumed the element can't already be in a list, so it isn't checked.
*/
-#define MT_LIST_ADD(_lh, _el) \
+#define MT_LIST_INSERT(_lh, _el) \
({ \
int _ret = 0; \
struct mt_list *lh = (_lh), *el = (_el); \
* Add an item at the end of a list.
* It is assumed the element can't already be in a list, so it isn't checked
*/
-#define MT_LIST_ADDQ(_lh, _el) \
+#define MT_LIST_APPEND(_lh, _el) \
({ \
int _ret = 0; \
struct mt_list *lh = (_lh), *el = (_el); \
/*
* Detach a list from its head. A pointer to the first element is returned
* and the list is closed. If the list was empty, NULL is returned. This may
- * exclusively be used with lists modified by MT_LIST_TRY_ADD/MT_LIST_TRY_ADDQ. This
- * is incompatible with MT_LIST_DEL run concurrently.
+ * exclusively be used with lists modified by MT_LIST_TRY_INSERT/MT_LIST_TRY_APPEND. This
+ * is incompatible with MT_LIST_DELETE run concurrently.
* If there's at least one element, the next of the last element will always
* be NULL.
*/
/* Remove an item from a list.
* Returns 1 if we removed the item, 0 otherwise (because it was in no list).
*/
-#define MT_LIST_DEL(_el) \
+#define MT_LIST_DELETE(_el) \
({ \
int _ret = 0; \
struct mt_list *el = (_el); \
/* checks if the list element <el> was added to a list or not. This only
* works when detached elements are reinitialized (using LIST_DEL_INIT)
*/
-#define MT_LIST_ADDED(el) ((el)->next != (el))
+#define MT_LIST_INLIST(el) ((el)->next != (el))
/* Lock an element in the list, to be sure it won't be removed.
* It needs to be synchronized somehow to be sure it's not removed
p->next = n; \
} while (0);
-/* Equivalent of MT_LIST_DEL(), to be used when parsing the list with mt_list_entry_for_each_safe().
+/* Equivalent of MT_LIST_DELETE(), to be used when parsing the list with mt_list_entry_for_each_safe().
* It should be the element currently parsed (tmpelt1)
*/
-#define MT_LIST_DEL_SAFE(_el) \
+#define MT_LIST_DELETE_SAFE(_el) \
do { \
struct mt_list *el = (_el); \
(el)->prev = (el); \
(_el) = NULL; \
} while (0)
-/* Safe as MT_LIST_DEL_SAFE, but it won't reinit the element */
-#define MT_LIST_DEL_SAFE_NOINIT(_el) \
+/* Safe as MT_LIST_DELETE_SAFE, but it won't reinit the element */
+#define MT_LIST_DELETE_SAFE_NOINIT(_el) \
do { \
(_el) = NULL; \
} while (0)
* the list is passed in <list_head>. A temporary variable <back> of same type
* as <item> is needed so that <item> may safely be deleted if needed.
* tmpelt1 is a temporary struct mt_list *, and tmpelt2 is a temporary
- * struct mt_list, used internally, both are needed for MT_LIST_DEL_SAFE.
+ * struct mt_list, used internally, both are needed for MT_LIST_DELETE_SAFE.
* Example: list_for_each_entry_safe(cur_acl, tmp, known_acl, list, elt1, elt2)
* { ... };
- * If you want to remove the current element, please use MT_LIST_DEL_SAFE.
+ * If you want to remove the current element, please use MT_LIST_DELETE_SAFE.
*/
#define mt_list_for_each_entry_safe(item, list_head, member, tmpelt, tmpelt2) \
for ((tmpelt) = NULL; (tmpelt) != MT_LIST_BUSY; ({ \
event_del(&frame->process_frame_event);
worker = frame->worker;
- LIST_DEL(&frame->list);
+ LIST_DELETE(&frame->list);
if (frame->frag_buf)
free(frame->frag_buf);
memset(frame, 0, sizeof(*frame)+max_frame_size+4);
- LIST_ADDQ(&worker->frames, &frame->list);
+ LIST_APPEND(&worker->frames, &frame->list);
}
static void
DEBUG(c->worker, "<%lu> Release client", c->id);
- LIST_DEL(&c->by_worker);
+ LIST_DELETE(&c->by_worker);
c->worker->nbclients--;
unuse_spoe_engine(c);
LIST_INIT(&eng->clients);
LIST_INIT(&eng->processing_frames);
LIST_INIT(&eng->outgoing_frames);
- LIST_ADDQ(&client->worker->engines, &eng->list);
+ LIST_APPEND(&client->worker->engines, &eng->list);
LOG(client->worker, "Add new SPOE engine '%s'", eng->id);
end:
client->engine = eng;
- LIST_ADDQ(&eng->clients, &client->by_engine);
+ LIST_APPEND(&eng->clients, &client->by_engine);
}
static void
eng = client->engine;
client->engine = NULL;
- LIST_DEL(&client->by_engine);
+ LIST_DELETE(&client->by_engine);
if (!LIST_ISEMPTY(&eng->clients))
return;
LOG(client->worker, "Remove SPOE engine '%s'", eng->id);
- LIST_DEL(&eng->list);
+ LIST_DELETE(&eng->list);
list_for_each_entry_safe(frame, back, &eng->processing_frames, list) {
release_frame(frame);
}
else {
frame = LIST_NEXT(&client->worker->frames, typeof(frame), list);
- LIST_DEL(&frame->list);
+ LIST_DELETE(&frame->list);
}
reset_frame(frame);
frame = client->outgoing_frame;
else if (!LIST_ISEMPTY(&client->outgoing_frames)) {
frame = LIST_NEXT(&client->outgoing_frames, typeof(frame), list);
- LIST_DEL(&frame->list);
+ LIST_DELETE(&frame->list);
client->outgoing_frame = frame;
}
else if (engine!= NULL && !LIST_ISEMPTY(&engine->outgoing_frames)) {
frame = LIST_NEXT(&engine->outgoing_frames, typeof(frame), list);
- LIST_DEL(&frame->list);
+ LIST_DELETE(&frame->list);
client->outgoing_frame = frame;
}
return frame;
{
uint32_t netint;
- LIST_DEL(&frame->list);
+ LIST_DELETE(&frame->list);
frame->buf = (char *)(frame->data);
frame->offset = 0;
if (client->outgoing_frame == NULL)
client->outgoing_frame = frame;
else
- LIST_ADD(&client->outgoing_frames, &frame->list);
+ LIST_INSERT(&client->outgoing_frames, &frame->list);
}
else {
client->outgoing_frame = frame;
}
else { /* for all other frames */
if (frame->client == NULL) { /* async mode ! */
- LIST_ADDQ(&frame->engine->outgoing_frames, &frame->list);
+ LIST_APPEND(&frame->engine->outgoing_frames, &frame->list);
list_for_each_entry(client, &frame->engine->clients, by_engine)
event_add(&client->write_frame_event, NULL);
}
else if (frame->client->pipelining) {
- LIST_ADDQ(&frame->client->outgoing_frames, &frame->list);
+ LIST_APPEND(&frame->client->outgoing_frames, &frame->list);
event_add(&frame->client->write_frame_event, NULL);
}
else {
if (client->async) {
frame->client = NULL;
- LIST_ADDQ(&frame->engine->processing_frames, &frame->list);
+ LIST_APPEND(&frame->engine->processing_frames, &frame->list);
}
else if (client->pipelining)
- LIST_ADDQ(&client->processing_frames, &frame->list);
+ LIST_APPEND(&client->processing_frames, &frame->list);
else
event_del(&client->read_frame_event);
}
LIST_INIT(&client->processing_frames);
LIST_INIT(&client->outgoing_frames);
- LIST_ADDQ(&worker->clients, &client->by_worker);
+ LIST_APPEND(&worker->clients, &client->by_worker);
worker->nbclients++;
}
list_for_each_entry_safe(frame, fback, &worker->frames, list) {
- LIST_DEL(&frame->list);
+ LIST_DELETE(&frame->list);
free(frame);
}
#define LIST_HEAD_INIT(l) { &l, &l }
/* adds an element at the beginning of a list ; returns the element */
-#define LIST_ADD(lh, el) ({ (el)->n = (lh)->n; (el)->n->p = (lh)->n = (el); (el)->p = (lh); (el); })
+#define LIST_INSERT(lh, el) ({ (el)->n = (lh)->n; (el)->n->p = (lh)->n = (el); (el)->p = (lh); (el); })
/* adds an element at the end of a list ; returns the element */
-#define LIST_ADDQ(lh, el) ({ (el)->p = (lh)->p; (el)->p->n = (lh)->p = (el); (el)->n = (lh); (el); })
+#define LIST_APPEND(lh, el) ({ (el)->p = (lh)->p; (el)->p->n = (lh)->p = (el); (el)->n = (lh); (el); })
/* removes an element from a list and returns it */
-#define LIST_DEL(el) ({ typeof(el) __ret = (el); (el)->n->p = (el)->p; (el)->p->n = (el)->n; (__ret); })
+#define LIST_DELETE(el) ({ typeof(el) __ret = (el); (el)->n->p = (el)->p; (el)->p->n = (el)->n; (__ret); })
/* returns a pointer of type <pt> to a structure containing a list head called
* <el> at address <lh>. Note that <lh> can be the result of a function or macro
event_del(&frame->process_frame_event);
worker = frame->worker;
- LIST_DEL(&frame->list);
+ LIST_DELETE(&frame->list);
if (frame->frag_buf)
free(frame->frag_buf);
memset(frame, 0, sizeof(*frame)+max_frame_size+4);
- LIST_ADDQ(&worker->frames, &frame->list);
+ LIST_APPEND(&worker->frames, &frame->list);
}
static void
DEBUG(c->worker, "<%lu> Release client", c->id);
- LIST_DEL(&c->by_worker);
+ LIST_DELETE(&c->by_worker);
c->worker->nbclients--;
unuse_spoe_engine(c);
LIST_INIT(&eng->clients);
LIST_INIT(&eng->processing_frames);
LIST_INIT(&eng->outgoing_frames);
- LIST_ADDQ(&client->worker->engines, &eng->list);
+ LIST_APPEND(&client->worker->engines, &eng->list);
LOG(client->worker, "Add new SPOE engine '%s'", eng->id);
end:
client->engine = eng;
- LIST_ADDQ(&eng->clients, &client->by_engine);
+ LIST_APPEND(&eng->clients, &client->by_engine);
}
static void
eng = client->engine;
client->engine = NULL;
- LIST_DEL(&client->by_engine);
+ LIST_DELETE(&client->by_engine);
if (!LIST_ISEMPTY(&eng->clients))
return;
LOG(client->worker, "Remove SPOE engine '%s'", eng->id);
- LIST_DEL(&eng->list);
+ LIST_DELETE(&eng->list);
list_for_each_entry_safe(frame, back, &eng->processing_frames, list) {
release_frame(frame);
}
else {
frame = LIST_NEXT(&client->worker->frames, typeof(frame), list);
- LIST_DEL(&frame->list);
+ LIST_DELETE(&frame->list);
}
reset_frame(frame);
frame = client->outgoing_frame;
else if (!LIST_ISEMPTY(&client->outgoing_frames)) {
frame = LIST_NEXT(&client->outgoing_frames, typeof(frame), list);
- LIST_DEL(&frame->list);
+ LIST_DELETE(&frame->list);
client->outgoing_frame = frame;
}
else if (engine!= NULL && !LIST_ISEMPTY(&engine->outgoing_frames)) {
frame = LIST_NEXT(&engine->outgoing_frames, typeof(frame), list);
- LIST_DEL(&frame->list);
+ LIST_DELETE(&frame->list);
client->outgoing_frame = frame;
}
return frame;
{
uint32_t netint;
- LIST_DEL(&frame->list);
+ LIST_DELETE(&frame->list);
frame->buf = (char *)(frame->data);
frame->offset = 0;
if (client->outgoing_frame == NULL)
client->outgoing_frame = frame;
else
- LIST_ADD(&client->outgoing_frames, &frame->list);
+ LIST_INSERT(&client->outgoing_frames, &frame->list);
}
else {
client->outgoing_frame = frame;
}
else { /* for all other frames */
if (frame->client == NULL) { /* async mode ! */
- LIST_ADDQ(&frame->engine->outgoing_frames, &frame->list);
+ LIST_APPEND(&frame->engine->outgoing_frames, &frame->list);
list_for_each_entry(client, &frame->engine->clients, by_engine)
event_add(&client->write_frame_event, NULL);
}
else if (frame->client->pipelining) {
- LIST_ADDQ(&frame->client->outgoing_frames, &frame->list);
+ LIST_APPEND(&frame->client->outgoing_frames, &frame->list);
event_add(&frame->client->write_frame_event, NULL);
}
else {
if (client->async) {
frame->client = NULL;
- LIST_ADDQ(&frame->engine->processing_frames, &frame->list);
+ LIST_APPEND(&frame->engine->processing_frames, &frame->list);
}
else if (client->pipelining)
- LIST_ADDQ(&client->processing_frames, &frame->list);
+ LIST_APPEND(&client->processing_frames, &frame->list);
else
event_del(&client->read_frame_event);
}
LIST_INIT(&client->processing_frames);
LIST_INIT(&client->outgoing_frames);
- LIST_ADDQ(&worker->clients, &client->by_worker);
+ LIST_APPEND(&worker->clients, &client->by_worker);
worker->nbclients++;
}
list_for_each_entry_safe(frame, fback, &worker->frames, list) {
- LIST_DEL(&frame->list);
+ LIST_DELETE(&frame->list);
free(frame);
}
-#FIG 3.2
+#FIG 3.2 Produced by xfig version 3.2.7b
Landscape
Center
Metric
-A4
-100.00
+A4
+119.50
Single
-2
1200 2
-6 720 8325 1080 9135
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
- 990 8765 765 8765
-2 2 0 2 0 6 53 0 20 0.000 0 0 -1 0 0 5
- 765 8415 990 8415 990 9090 765 9090 765 8415
-4 1 0 50 0 14 10 0.0000 4 90 90 880 8967 P\001
-4 1 0 50 0 14 10 0.0000 4 90 90 878 8640 N\001
--6
-6 1170 8325 1530 9135
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
- 1440 8765 1215 8765
-2 2 0 2 0 7 53 0 20 0.000 0 0 -1 0 0 5
- 1215 8415 1440 8415 1440 9090 1215 9090 1215 8415
-4 1 0 50 0 14 10 0.0000 4 90 90 1330 8967 P\001
-4 1 0 50 0 14 10 0.0000 4 90 90 1328 8640 N\001
--6
-6 1620 8325 1980 9135
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
- 1890 8765 1665 8765
-2 2 0 2 0 4 53 0 20 0.000 0 0 -1 0 0 5
- 1665 8415 1890 8415 1890 9090 1665 9090 1665 8415
-4 1 0 50 0 14 10 0.0000 4 90 90 1780 8967 P\001
-4 1 0 50 0 14 10 0.0000 4 90 90 1778 8640 N\001
--6
-6 2700 8055 3420 9225
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
- 3150 8675 2925 8675
-2 2 0 2 0 2 53 0 20 0.000 0 0 -1 0 0 5
- 2925 8325 3150 8325 3150 9000 2925 9000 2925 8325
-3 0 0 1 0 7 50 0 -1 0.000 0 1 0 6
- 1 1 1.00 60.00 120.00
- 3150 8505 3375 8505 3375 8100 2700 8100 2700 8505 2925 8505
- 0.000 1.000 1.000 1.000 1.000 0.000
-3 0 0 1 0 7 50 0 -1 0.000 0 1 0 6
- 1 1 1.00 60.00 120.00
- 3150 8820 3375 8820 3375 9225 2700 9225 2700 8820 2925 8820
- 0.000 1.000 1.000 1.000 1.000 0.000
-4 1 0 50 0 14 10 0.0000 4 90 90 3040 8877 P\001
-4 1 0 50 0 14 10 0.0000 4 90 90 3038 8550 N\001
--6
-6 2115 8100 2655 9180
-6 2115 8100 2655 9180
-6 2295 8235 2655 9045
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
- 2565 8675 2340 8675
-2 2 0 2 0 6 53 0 20 0.000 0 0 -1 0 0 5
- 2340 8325 2565 8325 2565 9000 2340 9000 2340 8325
-4 1 0 50 0 14 10 0.0000 4 90 90 2455 8877 P\001
-4 1 0 50 0 14 10 0.0000 4 90 90 2453 8550 N\001
--6
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
- 2565 8325 2115 8325
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
- 2115 9000 2565 9000
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 2115 8100 2565 8100 2565 9180 2115 9180 2115 8100
-4 1 0 50 0 14 12 0.0000 4 120 105 2250 8730 L\001
--6
--6
-6 3420 8100 4095 9225
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
- 3870 8675 3645 8675
-2 2 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 3645 8325 3870 8325 3870 9000 3645 9000 3645 8325
-3 0 0 1 0 7 50 0 -1 0.000 0 1 0 6
- 1 1 1.00 60.00 120.00
- 3870 8505 4095 8505 4095 8100 3420 8100 3420 8505 3645 8505
- 0.000 1.000 1.000 1.000 1.000 0.000
-3 0 0 1 0 7 50 0 -1 0.000 0 1 0 6
- 1 1 1.00 60.00 120.00
- 3870 8820 4095 8820 4095 9225 3420 9225 3420 8820 3645 8820
- 0.000 1.000 1.000 1.000 1.000 0.000
-4 1 0 50 0 14 10 0.0000 4 90 90 3760 8877 P\001
-4 1 0 50 0 14 10 0.0000 4 90 90 3758 8550 N\001
--6
-6 4275 8190 4725 9090
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 4275 8190 4725 8190 4725 9090 4275 9090 4275 8190
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
- 4275 8640 4725 8640
-4 1 0 50 0 16 24 0.0000 4 285 270 4500 8550 N\001
-4 1 0 50 0 16 24 0.0000 4 285 240 4500 9000 P\001
--6
-6 5175 8115 5655 8595
-2 2 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 5190 8130 5640 8130 5640 8580 5190 8580 5190 8130
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
- 5640 8355 5190 8355
-4 1 0 50 0 16 9 0.0000 4 90 90 5415 8490 P\001
-4 1 0 50 0 16 9 0.0000 4 90 90 5415 8310 N\001
--6
-6 4995 8655 5925 9135
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
- 5010 8895 5910 8895
-2 2 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 5010 8670 5910 8670 5910 9120 5010 9120 5010 8670
-4 1 0 50 0 14 10 0.0000 4 105 630 5460 8850 list *N\001
-4 1 0 50 0 14 10 0.0000 4 105 630 5460 9075 list *P\001
--6
-6 270 8325 630 9135
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
- 540 8765 315 8765
-2 2 0 2 0 2 53 0 20 0.000 0 0 -1 0 0 5
- 315 8415 540 8415 540 9090 315 9090 315 8415
-4 1 0 50 0 14 10 0.0000 4 90 90 430 8967 P\001
-4 1 0 50 0 14 10 0.0000 4 90 90 428 8640 N\001
--6
-6 4860 3420 5220 4230
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
- 5130 3860 4905 3860
-2 2 0 2 0 6 53 0 20 0.000 0 0 -1 0 0 5
- 4905 3510 5130 3510 5130 4185 4905 4185 4905 3510
-4 1 0 50 0 14 10 0.0000 4 90 90 5020 4062 P\001
-4 1 0 50 0 14 10 0.0000 4 90 90 5018 3735 N\001
--6
-6 5850 3420 6210 4230
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
- 6120 3860 5895 3860
-2 2 0 2 0 7 53 0 20 0.000 0 0 -1 0 0 5
- 5895 3510 6120 3510 6120 4185 5895 4185 5895 3510
-4 1 0 50 0 14 10 0.0000 4 90 90 6010 4062 P\001
-4 1 0 50 0 14 10 0.0000 4 90 90 6008 3735 N\001
--6
6 3960 3420 4320 4230
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
4230 3860 4005 3860
2 2 0 2 0 2 53 0 20 0.000 0 0 -1 0 0 5
4005 3510 4230 3510 4230 4185 4005 4185 4005 3510
-4 1 0 50 0 14 10 0.0000 4 90 90 4120 4062 P\001
-4 1 0 50 0 14 10 0.0000 4 90 90 4118 3735 N\001
+4 1 0 50 0 14 10 0.0000 4 105 105 4120 4062 P\001
+4 1 0 50 0 14 10 0.0000 4 105 105 4118 3735 N\001
-6
6 4185 5580 4545 6390
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
4455 6020 4230 6020
2 2 0 2 0 4 53 0 20 0.000 0 0 -1 0 0 5
4230 5670 4455 5670 4455 6345 4230 6345 4230 5670
-4 1 0 50 0 14 10 0.0000 4 90 90 4345 6222 P\001
-4 1 0 50 0 14 10 0.0000 4 90 90 4343 5895 N\001
+4 1 0 50 0 14 10 0.0000 4 105 105 4345 6222 P\001
+4 1 0 50 0 14 10 0.0000 4 105 105 4343 5895 N\001
-6
6 4905 5445 5445 6525
6 4905 5445 5445 6525
5355 6020 5130 6020
2 2 0 2 0 6 53 0 20 0.000 0 0 -1 0 0 5
5130 5670 5355 5670 5355 6345 5130 6345 5130 5670
-4 1 0 50 0 14 10 0.0000 4 90 90 5245 6222 P\001
-4 1 0 50 0 14 10 0.0000 4 90 90 5243 5895 N\001
+4 1 0 50 0 14 10 0.0000 4 105 105 5245 6222 P\001
+4 1 0 50 0 14 10 0.0000 4 105 105 5243 5895 N\001
-6
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
5355 5670 4905 5670
4905 6345 5355 6345
2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
4905 5445 5355 5445 5355 6525 4905 6525 4905 5445
-4 1 0 50 0 14 12 0.0000 4 120 105 5040 6075 L\001
+4 1 0 50 0 14 12 0.0000 4 120 120 5040 6075 L\001
-6
-6
6 5805 5445 6345 6525
6255 6020 6030 6020
2 2 0 2 0 6 53 0 20 0.000 0 0 -1 0 0 5
6030 5670 6255 5670 6255 6345 6030 6345 6030 5670
-4 1 0 50 0 14 10 0.0000 4 90 90 6145 6222 P\001
-4 1 0 50 0 14 10 0.0000 4 90 90 6143 5895 N\001
+4 1 0 50 0 14 10 0.0000 4 105 105 6145 6222 P\001
+4 1 0 50 0 14 10 0.0000 4 105 105 6143 5895 N\001
-6
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
6255 5670 5805 5670
5805 6345 6255 6345
2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
5805 5445 6255 5445 6255 6525 5805 6525 5805 5445
-4 1 0 50 0 14 12 0.0000 4 120 105 5940 6075 L\001
+4 1 0 50 0 14 12 0.0000 4 120 120 5940 6075 L\001
-6
-6
6 6705 5445 7245 6525
7155 6020 6930 6020
2 2 0 2 0 6 53 0 20 0.000 0 0 -1 0 0 5
6930 5670 7155 5670 7155 6345 6930 6345 6930 5670
-4 1 0 50 0 14 10 0.0000 4 90 90 7045 6222 P\001
-4 1 0 50 0 14 10 0.0000 4 90 90 7043 5895 N\001
+4 1 0 50 0 14 10 0.0000 4 105 105 7045 6222 P\001
+4 1 0 50 0 14 10 0.0000 4 105 105 7043 5895 N\001
-6
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
7155 5670 6705 5670
6705 6345 7155 6345
2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
6705 5445 7155 5445 7155 6525 6705 6525 6705 5445
-4 1 0 50 0 14 12 0.0000 4 120 105 6840 6075 L\001
+4 1 0 50 0 14 12 0.0000 4 120 120 6840 6075 L\001
-6
-6
6 450 5580 810 6390
720 6020 495 6020
2 2 0 2 0 4 53 0 20 0.000 0 0 -1 0 0 5
495 5670 720 5670 720 6345 495 6345 495 5670
-4 1 0 50 0 14 10 0.0000 4 90 90 610 6222 P\001
-4 1 0 50 0 14 10 0.0000 4 90 90 608 5895 N\001
+4 1 0 50 0 14 10 0.0000 4 105 105 610 6222 P\001
+4 1 0 50 0 14 10 0.0000 4 105 105 608 5895 N\001
-6
6 1170 5445 1710 6525
6 1170 5445 1710 6525
1620 6020 1395 6020
2 2 0 2 0 6 53 0 20 0.000 0 0 -1 0 0 5
1395 5670 1620 5670 1620 6345 1395 6345 1395 5670
-4 1 0 50 0 14 10 0.0000 4 90 90 1510 6222 P\001
-4 1 0 50 0 14 10 0.0000 4 90 90 1508 5895 N\001
+4 1 0 50 0 14 10 0.0000 4 105 105 1510 6222 P\001
+4 1 0 50 0 14 10 0.0000 4 105 105 1508 5895 N\001
-6
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
1620 5670 1170 5670
1170 6345 1620 6345
2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
1170 5445 1620 5445 1620 6525 1170 6525 1170 5445
-4 1 0 50 0 14 12 0.0000 4 120 105 1305 6075 L\001
+4 1 0 50 0 14 12 0.0000 4 120 120 1305 6075 L\001
-6
-6
6 2070 5445 2610 6525
2520 6020 2295 6020
2 2 0 2 0 6 53 0 20 0.000 0 0 -1 0 0 5
2295 5670 2520 5670 2520 6345 2295 6345 2295 5670
-4 1 0 50 0 14 10 0.0000 4 90 90 2410 6222 P\001
-4 1 0 50 0 14 10 0.0000 4 90 90 2408 5895 N\001
+4 1 0 50 0 14 10 0.0000 4 105 105 2410 6222 P\001
+4 1 0 50 0 14 10 0.0000 4 105 105 2408 5895 N\001
-6
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
2520 5670 2070 5670
2070 6345 2520 6345
2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
2070 5445 2520 5445 2520 6525 2070 6525 2070 5445
-4 1 0 50 0 14 12 0.0000 4 120 105 2205 6075 L\001
+4 1 0 50 0 14 12 0.0000 4 120 120 2205 6075 L\001
-6
-6
6 2970 5445 3510 6525
3420 6020 3195 6020
2 2 0 2 0 6 53 0 20 0.000 0 0 -1 0 0 5
3195 5670 3420 5670 3420 6345 3195 6345 3195 5670
-4 1 0 50 0 14 10 0.0000 4 90 90 3310 6222 P\001
-4 1 0 50 0 14 10 0.0000 4 90 90 3308 5895 N\001
+4 1 0 50 0 14 10 0.0000 4 105 105 3310 6222 P\001
+4 1 0 50 0 14 10 0.0000 4 105 105 3308 5895 N\001
-6
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
3420 5670 2970 5670
2970 6345 3420 6345
2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
2970 5445 3420 5445 3420 6525 2970 6525 2970 5445
-4 1 0 50 0 14 12 0.0000 4 120 105 3105 6075 L\001
+4 1 0 50 0 14 12 0.0000 4 120 120 3105 6075 L\001
-6
-6
6 720 3420 1080 4230
990 3860 765 3860
2 2 0 2 0 2 53 0 20 0.000 0 0 -1 0 0 5
765 3510 990 3510 990 4185 765 4185 765 3510
-4 1 0 50 0 14 10 0.0000 4 90 90 880 4062 P\001
-4 1 0 50 0 14 10 0.0000 4 90 90 878 3735 N\001
+4 1 0 50 0 14 10 0.0000 4 105 105 880 4062 P\001
+4 1 0 50 0 14 10 0.0000 4 105 105 878 3735 N\001
-6
6 2700 3420 3060 4230
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
2970 3860 2745 3860
2 2 0 2 0 6 53 0 20 0.000 0 0 -1 0 0 5
2745 3510 2970 3510 2970 4185 2745 4185 2745 3510
-4 1 0 50 0 14 10 0.0000 4 90 90 2860 4062 P\001
-4 1 0 50 0 14 10 0.0000 4 90 90 2858 3735 N\001
+4 1 0 50 0 14 10 0.0000 4 105 105 2860 4062 P\001
+4 1 0 50 0 14 10 0.0000 4 105 105 2858 3735 N\001
-6
6 1620 3465 1935 4230
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
1890 3860 1665 3860
2 2 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 5
1665 3510 1890 3510 1890 4185 1665 4185 1665 3510
-4 1 0 50 0 14 10 0.0000 4 90 90 1780 4062 P\001
-4 1 0 50 0 14 10 0.0000 4 90 90 1778 3735 N\001
+4 1 0 50 0 14 10 0.0000 4 105 105 1780 4062 P\001
+4 1 0 50 0 14 10 0.0000 4 105 105 1778 3735 N\001
-6
6 10485 3330 11025 4410
6 10665 3465 11025 4275
10935 3905 10710 3905
2 2 0 2 0 6 53 0 20 0.000 0 0 -1 0 0 5
10710 3555 10935 3555 10935 4230 10710 4230 10710 3555
-4 1 0 50 0 14 10 0.0000 4 90 90 10825 4107 P\001
-4 1 0 50 0 14 10 0.0000 4 90 90 10823 3780 N\001
+4 1 0 50 0 14 10 0.0000 4 105 105 10825 4107 P\001
+4 1 0 50 0 14 10 0.0000 4 105 105 10823 3780 N\001
-6
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
10935 3555 10485 3555
10485 4230 10935 4230
2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
10485 3330 10935 3330 10935 4410 10485 4410 10485 3330
-4 1 0 50 0 14 12 0.0000 4 120 105 10620 3960 L\001
+4 1 0 50 0 14 12 0.0000 4 120 120 10620 3960 L\001
-6
6 7110 3105 7650 4185
6 7110 3105 7650 4185
7560 3680 7335 3680
2 2 0 2 0 6 53 0 20 0.000 0 0 -1 0 0 5
7335 3330 7560 3330 7560 4005 7335 4005 7335 3330
-4 1 0 50 0 14 10 0.0000 4 90 90 7450 3882 P\001
-4 1 0 50 0 14 10 0.0000 4 90 90 7448 3555 N\001
+4 1 0 50 0 14 10 0.0000 4 105 105 7450 3882 P\001
+4 1 0 50 0 14 10 0.0000 4 105 105 7448 3555 N\001
-6
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
7560 3330 7110 3330
7110 4005 7560 4005
2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
7110 3105 7560 3105 7560 4185 7110 4185 7110 3105
-4 1 0 50 0 14 12 0.0000 4 120 105 7245 3735 L\001
+4 1 0 50 0 14 12 0.0000 4 120 120 7245 3735 L\001
-6
-6
6 8010 3105 8550 4185
8460 3680 8235 3680
2 2 0 2 0 6 53 0 20 0.000 0 0 -1 0 0 5
8235 3330 8460 3330 8460 4005 8235 4005 8235 3330
-4 1 0 50 0 14 10 0.0000 4 90 90 8350 3882 P\001
-4 1 0 50 0 14 10 0.0000 4 90 90 8348 3555 N\001
+4 1 0 50 0 14 10 0.0000 4 105 105 8350 3882 P\001
+4 1 0 50 0 14 10 0.0000 4 105 105 8348 3555 N\001
-6
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
8460 3330 8010 3330
8010 4005 8460 4005
2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
8010 3105 8460 3105 8460 4185 8010 4185 8010 3105
-4 1 0 50 0 14 12 0.0000 4 120 105 8145 3735 L\001
+4 1 0 50 0 14 12 0.0000 4 120 120 8145 3735 L\001
-6
-6
6 9315 990 12195 2160
9945 1520 9720 1520
2 2 0 2 0 2 53 0 20 0.000 0 0 -1 0 0 5
9720 1170 9945 1170 9945 1845 9720 1845 9720 1170
-4 1 0 50 0 14 10 0.0000 4 90 90 9835 1722 P\001
-4 1 0 50 0 14 10 0.0000 4 90 90 9833 1395 N\001
+4 1 0 50 0 14 10 0.0000 4 105 105 9835 1722 P\001
+4 1 0 50 0 14 10 0.0000 4 105 105 9833 1395 N\001
-6
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
10935 1520 10710 1520
1 1 1.00 60.00 120.00
10665 1710 9945 1710
0.000 0.000
-4 1 0 50 0 14 10 0.0000 4 90 90 10825 1722 P\001
-4 1 0 50 0 14 10 0.0000 4 90 90 10823 1395 N\001
-4 1 0 50 0 14 10 0.0000 4 90 90 11815 1722 P\001
-4 1 0 50 0 14 10 0.0000 4 90 90 11813 1395 N\001
+4 1 0 50 0 14 10 0.0000 4 105 105 10825 1722 P\001
+4 1 0 50 0 14 10 0.0000 4 105 105 10823 1395 N\001
+4 1 0 50 0 14 10 0.0000 4 105 105 11815 1722 P\001
+4 1 0 50 0 14 10 0.0000 4 105 105 11813 1395 N\001
-6
6 6345 1080 6705 1890
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
6615 1520 6390 1520
2 2 0 2 0 2 53 0 20 0.000 0 0 -1 0 0 5
6390 1170 6615 1170 6615 1845 6390 1845 6390 1170
-4 1 0 50 0 14 10 0.0000 4 90 90 6505 1722 P\001
-4 1 0 50 0 14 10 0.0000 4 90 90 6503 1395 N\001
+4 1 0 50 0 14 10 0.0000 4 105 105 6505 1722 P\001
+4 1 0 50 0 14 10 0.0000 4 105 105 6503 1395 N\001
-6
6 7335 1080 7695 1890
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
7605 1520 7380 1520
2 2 0 2 0 6 52 0 20 0.000 0 0 -1 0 0 5
7380 1170 7605 1170 7605 1845 7380 1845 7380 1170
-4 1 0 50 0 14 10 0.0000 4 90 90 7495 1722 P\001
-4 1 0 50 0 14 10 0.0000 4 90 90 7493 1395 N\001
+4 1 0 50 0 14 10 0.0000 4 105 105 7495 1722 P\001
+4 1 0 50 0 14 10 0.0000 4 105 105 7493 1395 N\001
-6
6 8325 1080 8685 1890
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
8595 1520 8370 1520
2 2 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 5
8370 1170 8595 1170 8595 1845 8370 1845 8370 1170
-4 1 0 50 0 14 10 0.0000 4 90 90 8485 1722 P\001
-4 1 0 50 0 14 10 0.0000 4 90 90 8483 1395 N\001
+4 1 0 50 0 14 10 0.0000 4 105 105 8485 1722 P\001
+4 1 0 50 0 14 10 0.0000 4 105 105 8483 1395 N\001
-6
6 3870 1215 4185 1980
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
4140 1610 3915 1610
2 2 0 2 0 2 53 0 20 0.000 0 0 -1 0 0 5
3915 1260 4140 1260 4140 1935 3915 1935 3915 1260
-4 1 0 50 0 14 10 0.0000 4 90 90 4030 1812 P\001
-4 1 0 50 0 14 10 0.0000 4 90 90 4028 1485 N\001
+4 1 0 50 0 14 10 0.0000 4 105 105 4030 1812 P\001
+4 1 0 50 0 14 10 0.0000 4 105 105 4028 1485 N\001
-6
6 4770 1215 5085 1980
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
5040 1610 4815 1610
2 2 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 5
4815 1260 5040 1260 5040 1935 4815 1935 4815 1260
-4 1 0 50 0 14 10 0.0000 4 90 90 4930 1812 P\001
-4 1 0 50 0 14 10 0.0000 4 90 90 4928 1485 N\001
+4 1 0 50 0 14 10 0.0000 4 105 105 4930 1812 P\001
+4 1 0 50 0 14 10 0.0000 4 105 105 4928 1485 N\001
-6
6 2205 990 2925 2160
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
1 1 1.00 60.00 120.00
2655 1755 2880 1755 2880 2160 2205 2160 2205 1755 2430 1755
0.000 1.000 1.000 1.000 1.000 0.000
-4 1 0 50 0 14 10 0.0000 4 90 90 2545 1812 P\001
-4 1 0 50 0 14 10 0.0000 4 90 90 2543 1485 N\001
+4 1 0 50 0 14 10 0.0000 4 105 105 2545 1812 P\001
+4 1 0 50 0 14 10 0.0000 4 105 105 2543 1485 N\001
-6
6 525 1350 1455 1830
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
540 1590 1440 1590
2 2 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 5
540 1365 1440 1365 1440 1815 540 1815 540 1365
-4 1 0 50 0 14 10 0.0000 4 105 630 990 1545 list *N\001
-4 1 0 50 0 14 10 0.0000 4 105 630 990 1770 list *P\001
+4 1 0 50 0 14 10 0.0000 4 105 735 990 1545 list *N\001
+4 1 0 50 0 14 10 0.0000 4 105 735 990 1770 list *P\001
+-6
+6 4815 3420 5175 4230
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
+ 5085 3860 4860 3860
+2 2 0 2 0 7 53 0 20 0.000 0 0 -1 0 0 5
+ 4860 3510 5085 3510 5085 4185 4860 4185 4860 3510
+4 1 0 50 0 14 10 0.0000 4 105 105 4975 4062 P\001
+4 1 0 50 0 14 10 0.0000 4 105 105 4973 3735 N\001
+-6
+6 5715 3285 6390 4410
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
+ 6165 3860 5940 3860
+2 2 0 2 0 6 53 0 20 0.000 0 0 -1 0 0 5
+ 5940 3510 6165 3510 6165 4185 5940 4185 5940 3510
+3 0 0 1 0 7 50 0 -1 0.000 0 1 0 6
+ 1 1 1.00 60.00 120.00
+ 6165 3690 6390 3690 6390 3285 5715 3285 5715 3690 5940 3690
+ 0.000 1.000 1.000 1.000 1.000 0.000
+3 0 0 1 0 7 50 0 -1 0.000 0 1 0 6
+ 1 1 1.00 60.00 120.00
+ 6165 4005 6390 4005 6390 4410 5715 4410 5715 4005 5940 4005
+ 0.000 1.000 1.000 1.000 1.000 0.000
+4 1 0 50 0 14 10 0.0000 4 105 105 6055 4062 P\001
+4 1 0 50 0 14 10 0.0000 4 105 105 6053 3735 N\001
-6
-2 4 0 1 0 7 50 0 -1 0.000 0 0 7 0 0 5
- 3330 2475 6435 2475 6435 4500 3330 4500 3330 2475
2 4 0 1 0 7 50 0 -1 0.000 0 0 7 0 0 5
4050 4725 7605 4725 7605 6840 4050 6840 4050 4725
-2 4 0 1 0 7 50 0 -1 0.000 0 0 7 0 0 5
- 12600 6840 12600 4725 7785 4725 7785 6840 12600 6840
2 4 0 1 0 7 50 0 -1 0.000 0 0 7 0 0 5
315 4725 3870 4725 3870 6840 315 6840 315 4725
2 4 0 1 0 7 50 0 -1 0.000 0 0 7 0 0 5
1845 270 3240 270 3240 2250 1845 2250 1845 270
2 4 0 1 0 7 50 0 -1 0.000 0 0 7 0 0 5
315 270 1620 270 1620 2250 315 2250 315 270
+2 4 0 1 0 7 50 0 -1 0.000 0 0 7 0 0 5
+ 3330 2475 6435 2475 6435 4500 3330 4500 3330 2475
+2 4 0 1 0 7 50 0 -1 0.000 0 0 7 0 0 5
+ 12285 6840 12285 4725 7785 4725 7785 6840 12285 6840
3 0 0 1 0 7 50 0 -1 0.000 0 1 0 2
1 1 1.00 60.00 120.00
4230 3690 4860 3690
1 1 1.00 60.00 120.00
4860 4050 4230 4050
0.000 0.000
-3 0 0 1 0 7 50 0 -1 0.000 0 1 0 7
- 1 1 1.00 60.00 120.00
- 5130 3690 5580 3690 5580 3240 3600 3240 3600 3690 3780 3690
- 3960 3690
- 0.000 1.000 1.000 1.000 1.000 1.000 0.000
3 0 0 1 0 7 50 0 -1 0.000 0 1 0 7
1 1 1.00 60.00 120.00
3960 4050 3780 4050 3600 4050 3600 4410 5580 4410 5580 4050
3870 1800 3690 1800 3510 1800 3510 2160 5490 2160 5490 1800
5040 1800
0.000 1.000 1.000 1.000 1.000 1.000 0.000
-4 1 0 50 0 14 10 0.0000 4 135 3240 5805 4950 Asymmetrical list starting at R(red)\001
-4 0 0 50 0 12 10 0.0000 4 135 3780 7875 5715 - FOREACH_ITEM(it, R, end, struct foo*, L)\001
-4 0 0 50 0 12 10 0.0000 4 105 2610 7875 5490 - last element has R->P == &L\001
-4 1 0 50 0 14 10 0.0000 4 135 3510 10215 4950 Symmetrical lists vs Asymmetrical lists\001
-4 0 0 50 0 12 10 0.0000 4 135 4680 7875 6165 - FOREACH_ITEM_SAFE(it, bck, R, end, struct foo*, L)\001
-4 0 0 50 0 12 10 0.0000 4 135 4500 7875 6390 does the same except that <bck> allows to delete\001
-4 0 0 50 0 12 10 0.0000 4 135 2340 7875 6570 any node, including <it>\001
-4 1 0 50 0 12 10 0.0000 4 135 450 5130 5355 foo_0\001
-4 1 0 50 0 12 10 0.0000 4 135 450 6030 5355 foo_1\001
-4 1 0 50 0 12 10 0.0000 4 135 450 6930 5355 foo_2\001
-4 1 0 50 0 14 10 0.0000 4 135 3150 2070 4950 Symmetrical list starting at R(red)\001
-4 1 0 50 0 12 10 0.0000 4 135 450 3195 5355 foo_2\001
-4 1 0 50 0 12 10 0.0000 4 135 450 2295 5355 foo_1\001
-4 1 0 50 0 12 10 0.0000 4 135 450 1395 5355 foo_0\001
-4 1 0 50 0 12 10 0.0000 4 105 270 9855 3420 foo\001
-4 1 0 50 0 12 10 0.0000 4 90 90 9990 3825 E\001
-4 1 0 50 0 12 10 0.0000 4 135 2520 4905 3015 Replaces W with Y, returns W\001
-4 1 0 50 0 14 10 0.0000 4 135 1440 7785 2655 Linking elements\001
-4 1 0 50 0 12 10 0.0000 4 135 450 8235 3015 foo_1\001
-4 1 0 50 0 12 10 0.0000 4 135 450 7335 3015 foo_0\001
-4 1 0 50 0 12 10 0.0000 4 135 3060 7425 810 adds Y(yellow) just after G(green)\001
-4 1 0 50 0 12 10 0.0000 4 135 1170 4500 855 adds W(white)\001
-4 1 0 50 0 12 10 0.0000 4 135 2700 10755 810 adds Y at the queue (before G)\001
-4 1 0 50 0 12 12 0.0000 4 165 630 990 1080 P=prev\001
-4 1 0 50 0 14 12 0.0000 4 135 1155 945 585 struct list\001
-4 1 0 50 0 12 12 0.0000 4 120 630 990 855 N=next\001
-4 1 0 50 0 12 10 0.0000 4 105 1080 2565 900 Terminates G\001
-4 1 0 50 0 14 10 0.0000 4 105 1260 2565 675 struct list *G\001
-4 1 0 50 0 14 10 0.0000 4 135 1260 2565 495 LIST_INIT(G):G\001
-4 1 0 50 0 14 10 0.0000 4 135 1350 4500 495 LIST_ADD(G,W):W\001
-4 1 0 50 0 14 10 0.0000 4 135 1440 4500 675 LIST_ADDQ(G,W):W\001
-4 1 0 50 0 14 10 0.0000 4 135 1350 7425 540 LIST_ADD(G,Y):Y\001
-4 1 0 50 0 14 10 0.0000 4 135 1440 10755 540 LIST_ADDQ(G,Y):Y\001
-4 1 0 50 0 12 10 0.0000 4 135 2610 1755 3060 unlinks and returns Y(yellow)\001
-4 1 0 50 0 14 10 0.0000 4 135 1170 1755 2790 LIST_DEL(Y):Y\001
-4 1 0 50 0 14 10 0.0000 4 135 1440 4905 2745 LIST_RIWI(W,Y):W\001
-4 1 0 50 0 12 10 0.0000 4 135 2790 10665 3105 containing header E as member L\001
-4 1 0 50 0 14 10 0.0000 4 135 2880 10665 2700 foo=LIST_ELEM(E, struct foo*, L)\001
-4 1 0 50 0 12 10 0.0000 4 135 2880 10665 2925 Returns a pointer to struct foo*\001
-4 0 0 50 0 12 10 0.0000 4 135 2610 7875 5265 - both are empty if R->P == R\001
-4 0 0 50 0 12 10 0.0000 4 135 3960 7875 5940 iterates <it> through foo{0,1,2} and stops\001
+3 0 0 1 0 7 50 0 -1 0.000 0 1 0 7
+ 1 1 1.00 60.00 120.00
+ 5130 3690 5580 3690 5580 3240 3600 3240 3600 3690 3780 3690
+ 3960 3690
+ 0.000 1.000 1.000 1.000 1.000 1.000 0.000
+4 1 0 50 0 14 10 0.0000 4 135 3780 5805 4950 Asymmetrical list starting at R(red)\001
+4 1 0 50 0 14 10 0.0000 4 135 4095 10215 4950 Symmetrical lists vs Asymmetrical lists\001
+4 1 0 50 0 12 10 0.0000 4 135 525 5130 5355 foo_0\001
+4 1 0 50 0 12 10 0.0000 4 135 525 6030 5355 foo_1\001
+4 1 0 50 0 12 10 0.0000 4 135 525 6930 5355 foo_2\001
+4 1 0 50 0 14 10 0.0000 4 135 3675 2070 4950 Symmetrical list starting at R(red)\001
+4 1 0 50 0 12 10 0.0000 4 135 525 3195 5355 foo_2\001
+4 1 0 50 0 12 10 0.0000 4 135 525 2295 5355 foo_1\001
+4 1 0 50 0 12 10 0.0000 4 135 525 1395 5355 foo_0\001
+4 1 0 50 0 12 10 0.0000 4 105 315 9855 3420 foo\001
+4 1 0 50 0 12 10 0.0000 4 105 105 9990 3825 E\001
+4 1 0 50 0 14 10 0.0000 4 135 1680 7785 2655 Linking elements\001
+4 1 0 50 0 12 10 0.0000 4 135 525 8235 3015 foo_1\001
+4 1 0 50 0 12 10 0.0000 4 135 525 7335 3015 foo_0\001
+4 1 0 50 0 14 10 0.0000 4 105 1470 2565 675 struct list *G\001
+4 1 0 50 0 14 10 0.0000 4 135 1470 2565 495 LIST_INIT(G):G\001
+4 1 0 50 0 14 10 0.0000 4 135 1890 4500 495 LIST_INSERT(G,W):W\001
+4 1 0 50 0 14 10 0.0000 4 135 3360 10665 2700 foo=LIST_ELEM(E, struct foo*, L)\001
+4 1 0 50 0 14 10 0.0000 4 135 1890 4500 675 LIST_APPEND(G,W):W\001
+4 1 0 50 0 14 10 0.0000 4 135 1890 7425 540 LIST_INSERT(G,Y):Y\001
+4 1 0 50 0 14 10 0.0000 4 135 1890 10755 540 LIST_APPEND(G,Y):Y\001
+4 1 0 50 0 14 10 0.0000 4 135 1680 1755 2790 LIST_DELETE(Y):Y\001
+4 1 0 50 0 14 10 0.0000 4 135 1890 4905 2745 LIST_DEL_INIT(Y):Y\001
+4 1 0 50 0 12 9 0.0000 4 120 2880 10665 2925 Returns a pointer to struct foo*\001
+4 1 0 50 0 12 9 0.0000 4 120 2790 10665 3105 containing header E as member L\001
+4 1 0 50 0 12 9 0.0000 4 120 2700 10755 810 adds Y at the queue (before G)\001
+4 1 0 50 0 12 9 0.0000 4 120 3060 7425 810 adds Y(yellow) just after G(green)\001
+4 1 0 50 0 12 9 0.0000 4 120 1170 4500 855 adds W(white)\001
+4 1 0 50 0 12 9 0.0000 4 105 1080 2565 900 Terminates G\001
+4 1 0 50 0 12 9 0.0000 4 90 540 990 855 N=next\001
+4 1 0 50 0 12 9 0.0000 4 105 540 990 1080 P=prev\001
+4 1 0 50 0 12 9 0.0000 4 120 2610 1755 3060 unlinks and returns Y(yellow)\001
+4 1 0 50 0 12 9 0.0000 4 120 2610 4905 3060 unlinks, inits, and returns Y\001
+4 0 0 50 0 12 8 0.0000 4 105 2175 7875 5265 - both are empty if R->P == R\001
+4 0 0 50 0 12 8 0.0000 4 90 2175 7875 5490 - last element has R->P == &L\001
+4 0 0 50 0 12 8 0.0000 4 105 3150 7875 5715 - FOREACH_ITEM(it, R, end, struct foo*, L)\001
+4 0 0 50 0 12 8 0.0000 4 105 3300 7875 5940 iterates <it> through foo{0,1,2} and stops\001
+4 0 0 50 0 12 8 0.0000 4 105 3900 7875 6165 - FOREACH_ITEM_SAFE(it, bck, R, end, struct foo*, L)\001
+4 0 0 50 0 12 8 0.0000 4 105 3750 7875 6390 does the same except that <bck> allows to delete\001
+4 0 0 50 0 12 8 0.0000 4 105 1950 7875 6570 any node, including <it>\001
+4 1 0 50 0 14 11 0.0000 4 135 1155 945 585 struct list\001
static inline void __appctx_free(struct appctx *appctx)
{
task_destroy(appctx->t);
- if (LIST_ADDED(&appctx->buffer_wait.list))
+ if (LIST_INLIST(&appctx->buffer_wait.list))
LIST_DEL_INIT(&appctx->buffer_wait.list);
pool_free(pool_head_appctx, appctx);
if (b_alloc(&chn->buf) != NULL)
return 1;
- if (!LIST_ADDED(&wait->list))
- LIST_ADDQ(&ti->buffer_wq, &wait->list);
+ if (!LIST_INLIST(&wait->list))
+ LIST_APPEND(&ti->buffer_wq, &wait->list);
return 0;
}
{
/* If the connection is owned by the session, remove it from its list
*/
- if (LIST_ADDED(&conn->session_list)) {
+ if (LIST_INLIST(&conn->session_list)) {
session_unown_conn(conn->owner, conn);
}
else if (!(conn->flags & CO_FL_PRIVATE)) {
* already scheduled from cleaning but is freed before via another
* call.
*/
- MT_LIST_DEL(&conn->toremove_list);
+ MT_LIST_DELETE(&conn->toremove_list);
sockaddr_free(&conn->src);
sockaddr_free(&conn->dst);
/* registers proto mux list <list>. Modifies the list element! */
static inline void register_mux_proto(struct mux_proto_list *list)
{
- LIST_ADDQ(&mux_proto_list.list, &list->list);
+ LIST_APPEND(&mux_proto_list.list, &list->list);
}
/* unregisters proto mux list <list> */
static inline void unregister_mux_proto(struct mux_proto_list *list)
{
- LIST_DEL(&list->list);
+ LIST_DELETE(&list->list);
LIST_INIT(&list->list);
}
static inline void http_req_keywords_register(struct action_kw_list *kw_list)
{
- LIST_ADDQ(&http_req_keywords.list, &kw_list->list);
+ LIST_APPEND(&http_req_keywords.list, &kw_list->list);
}
static inline void http_res_keywords_register(struct action_kw_list *kw_list)
{
- LIST_ADDQ(&http_res_keywords.list, &kw_list->list);
+ LIST_APPEND(&http_res_keywords.list, &kw_list->list);
}
static inline void http_after_res_keywords_register(struct action_kw_list *kw_list)
{
- LIST_ADDQ(&http_after_res_keywords.list, &kw_list->list);
+ LIST_APPEND(&http_after_res_keywords.list, &kw_list->list);
}
struct action_kw *action_http_req_custom(const char *kw);
#define LIST_HEAD_INIT(l) { &l, &l }
/* adds an element at the beginning of a list ; returns the element */
-#define LIST_ADD(lh, el) ({ (el)->n = (lh)->n; (el)->n->p = (lh)->n = (el); (el)->p = (lh); (el); })
+#define LIST_INSERT(lh, el) ({ (el)->n = (lh)->n; (el)->n->p = (lh)->n = (el); (el)->p = (lh); (el); })
/* adds an element at the end of a list ; returns the element */
-#define LIST_ADDQ(lh, el) ({ (el)->p = (lh)->p; (el)->p->n = (lh)->p = (el); (el)->n = (lh); (el); })
+#define LIST_APPEND(lh, el) ({ (el)->p = (lh)->p; (el)->p->n = (lh)->p = (el); (el)->n = (lh); (el); })
/* adds the contents of a list <old> at the beginning of another list <new>. The old list head remains untouched. */
#define LIST_SPLICE(new, old) do { \
} while (0)
/* removes an element from a list and returns it */
-#define LIST_DEL(el) ({ typeof(el) __ret = (el); (el)->n->p = (el)->p; (el)->p->n = (el)->n; (__ret); })
+#define LIST_DELETE(el) ({ typeof(el) __ret = (el); (el)->n->p = (el)->p; (el)->p->n = (el)->n; (__ret); })
/* removes an element from a list, initializes it and returns it.
- * This is faster than LIST_DEL+LIST_INIT as we avoid reloading the pointers.
+ * This is faster than LIST_DELETE+LIST_INIT as we avoid reloading the pointers.
*/
#define LIST_DEL_INIT(el) ({ \
typeof(el) __ret = (el); \
/* checks if the list element <el> was added to a list or not. This only
* works when detached elements are reinitialized (using LIST_DEL_INIT)
*/
-#define LIST_ADDED(el) ((el)->n != (el))
+#define LIST_INLIST(el) ((el)->n != (el))
/* returns a pointer of type <pt> to a structure following the element
* which contains list head <lh>, which is known as element <el> in
* Returns 1 if we added the item, 0 otherwise (because it was already in a
* list).
*/
-#define MT_LIST_TRY_ADD(_lh, _el) \
+#define MT_LIST_TRY_INSERT(_lh, _el) \
({ \
int _ret = 0; \
struct mt_list *lh = (_lh), *el = (_el); \
* Returns 1 if we added the item, 0 otherwise (because it was already in a
* list).
*/
-#define MT_LIST_TRY_ADDQ(_lh, _el) \
+#define MT_LIST_TRY_APPEND(_lh, _el) \
({ \
int _ret = 0; \
struct mt_list *lh = (_lh), *el = (_el); \
* Add an item at the beginning of a list.
* It is assumed the element can't already be in a list, so it isn't checked.
*/
-#define MT_LIST_ADD(_lh, _el) \
+#define MT_LIST_INSERT(_lh, _el) \
({ \
int _ret = 0; \
struct mt_list *lh = (_lh), *el = (_el); \
* Add an item at the end of a list.
* It is assumed the element can't already be in a list, so it isn't checked
*/
-#define MT_LIST_ADDQ(_lh, _el) \
+#define MT_LIST_APPEND(_lh, _el) \
({ \
int _ret = 0; \
struct mt_list *lh = (_lh), *el = (_el); \
/*
* Detach a list from its head. A pointer to the first element is returned
* and the list is closed. If the list was empty, NULL is returned. This may
- * exclusively be used with lists modified by MT_LIST_TRY_ADD/MT_LIST_TRY_ADDQ. This
- * is incompatible with MT_LIST_DEL run concurrently.
+ * exclusively be used with lists modified by MT_LIST_TRY_INSERT/MT_LIST_TRY_APPEND. This
+ * is incompatible with MT_LIST_DELETE run concurrently.
* If there's at least one element, the next of the last element will always
* be NULL.
*/
/* Remove an item from a list.
* Returns 1 if we removed the item, 0 otherwise (because it was in no list).
*/
-#define MT_LIST_DEL(_el) \
+#define MT_LIST_DELETE(_el) \
({ \
int _ret = 0; \
struct mt_list *el = (_el); \
/* checks if the list element <el> was added to a list or not. This only
* works when detached elements are reinitialized (using LIST_DEL_INIT)
*/
-#define MT_LIST_ADDED(el) ((el)->next != (el))
+#define MT_LIST_INLIST(el) ((el)->next != (el))
/* Lock an element in the list, to be sure it won't be removed.
* It needs to be synchronized somehow to be sure it's not removed
p->next = n; \
} while (0);
-/* Equivalent of MT_LIST_DEL(), to be used when parsing the list with mt_list_entry_for_each_safe().
+/* Equivalent of MT_LIST_DELETE(), to be used when parsing the list with mt_list_entry_for_each_safe().
* It should be the element currently parsed (tmpelt1)
*/
-#define MT_LIST_DEL_SAFE(_el) \
+#define MT_LIST_DELETE_SAFE(_el) \
do { \
struct mt_list *el = (_el); \
(el)->prev = (el); \
(_el) = NULL; \
} while (0)
-/* Safe as MT_LIST_DEL_SAFE, but it won't reinit the element */
-#define MT_LIST_DEL_SAFE_NOINIT(_el) \
+/* Safe as MT_LIST_DELETE_SAFE, but it won't reinit the element */
+#define MT_LIST_DELETE_SAFE_NOINIT(_el) \
do { \
(_el) = NULL; \
} while (0)
* the list is passed in <list_head>. A temporary variable <back> of same type
* as <item> is needed so that <item> may safely be deleted if needed.
* tmpelt1 is a temporary struct mt_list *, and tmpelt2 is a temporary
- * struct mt_list, used internally, both are needed for MT_LIST_DEL_SAFE.
+ * struct mt_list, used internally, both are needed for MT_LIST_DELETE_SAFE.
* Example: list_for_each_entry_safe(cur_acl, tmp, known_acl, list, elt1, elt2)
* { ... };
- * If you want to remove the current element, please use MT_LIST_DEL_SAFE.
+ * If you want to remove the current element, please use MT_LIST_DELETE_SAFE.
*/
#define mt_list_for_each_entry_safe(item, list_head, member, tmpelt, tmpelt2) \
for ((tmpelt) = NULL; (tmpelt) != MT_LIST_BUSY; ({ \
goto err;
}
- LIST_ADDQ(&fe->conf.bind, &bind_conf->by_fe);
+ LIST_APPEND(&fe->conf.bind, &bind_conf->by_fe);
bind_conf->settings.ux.uid = -1;
bind_conf->settings.ux.gid = -1;
bind_conf->settings.ux.mode = 0;
ph->count--;
pool_cache_bytes -= pool->size;
pool_cache_count--;
- LIST_DEL(&item->by_pool);
- LIST_DEL(&item->by_lru);
+ LIST_DELETE(&item->by_pool);
+ LIST_DELETE(&item->by_lru);
#ifdef DEBUG_MEMORY_POOLS
/* keep track of where the element was allocated from */
*POOL_LINK(pool, item) = (void *)pool;
* conn->owner that points to a dead session, but in this case the
* element is not linked.
*/
- if (!LIST_ADDED(&conn->session_list))
+ if (!LIST_INLIST(&conn->session_list))
return;
if (conn->flags & CO_FL_SESS_IDLE)
list_for_each_entry(srv_list, &sess->srv_list, srv_list) {
if (srv_list->target == conn->target) {
if (LIST_ISEMPTY(&srv_list->conn_list)) {
- LIST_DEL(&srv_list->srv_list);
+ LIST_DELETE(&srv_list->srv_list);
pool_free(pool_head_sess_srv_list, srv_list);
}
break;
return 0;
srv_list->target = target;
LIST_INIT(&srv_list->conn_list);
- LIST_ADDQ(&sess->srv_list, &srv_list->srv_list);
+ LIST_APPEND(&sess->srv_list, &srv_list->srv_list);
}
- LIST_ADDQ(&srv_list->conn_list, &conn->session_list);
+ LIST_APPEND(&srv_list->conn_list, &conn->session_list);
return 1;
}
struct shared_block *s)
{
shctx->nbav--;
- LIST_DEL(&s->list);
- LIST_ADD(head, &s->list);
+ LIST_DELETE(&s->list);
+ LIST_INSERT(head, &s->list);
}
static inline void shctx_block_set_hot(struct shared_context *shctx,
struct shared_block *s)
{
shctx->nbav--;
- LIST_DEL(&s->list);
- LIST_ADDQ(&shctx->hot, &s->list);
+ LIST_DELETE(&s->list);
+ LIST_APPEND(&shctx->hot, &s->list);
}
static inline void shctx_block_set_avail(struct shared_context *shctx,
struct shared_block *s)
{
shctx->nbav++;
- LIST_DEL(&s->list);
- LIST_ADDQ(&shctx->avail, &s->list);
+ LIST_DELETE(&s->list);
+ LIST_APPEND(&shctx->avail, &s->list);
}
#endif /* __HAPROXY_SHCTX_H */
static inline void stream_add_srv_conn(struct stream *strm, struct server *srv)
{
/* note: this inserts in reverse order but we do not care, it's only
- * used for massive kills (i.e. almost never). MT_LIST_ADD() is a bit
- * faster than MT_LIST_ADDQ under contention due to a faster recovery
- * from a conflict with an adjacent MT_LIST_DEL, and using it improves
+ * used for massive kills (i.e. almost never). MT_LIST_INSERT() is a bit
+ * faster than MT_LIST_APPEND under contention due to a faster recovery
+ * from a conflict with an adjacent MT_LIST_DELETE, and using it improves
* the performance by about 3% on 32-cores.
*/
- MT_LIST_ADD(&srv->per_thr[tid].streams, &strm->by_srv);
+ MT_LIST_INSERT(&srv->per_thr[tid].streams, &strm->by_srv);
HA_ATOMIC_STORE(&strm->srv_conn, srv);
}
if (!srv)
return;
- MT_LIST_DEL(&strm->by_srv);
+ MT_LIST_DELETE(&strm->by_srv);
HA_ATOMIC_STORE(&strm->srv_conn, NULL);
}
/* Try to remove a tasklet from the list. This call is inherently racy and may
* only be performed on the thread that was supposed to dequeue this tasklet.
- * This way it is safe to call MT_LIST_DEL without first removing the
+ * This way it is safe to call MT_LIST_DELETE without first removing the
* TASK_IN_LIST bit, which must absolutely be removed afterwards in case
* another thread would want to wake this tasklet up in parallel.
*/
static inline void tasklet_remove_from_tasklet_list(struct tasklet *t)
{
- if (MT_LIST_DEL((struct mt_list *)&t->list)) {
+ if (MT_LIST_DELETE((struct mt_list *)&t->list)) {
_HA_ATOMIC_AND(&t->state, ~TASK_IN_LIST);
_HA_ATOMIC_DEC(&task_per_thread[t->tid >= 0 ? t->tid : tid].rq_total);
}
/* Should only be called by the thread responsible for the tasklet */
static inline void tasklet_free(struct tasklet *tl)
{
- if (MT_LIST_DEL((struct mt_list *)&tl->list))
+ if (MT_LIST_DELETE((struct mt_list *)&tl->list))
_HA_ATOMIC_DEC(&task_per_thread[tl->tid >= 0 ? tl->tid : tid].rq_total);
#ifdef DEBUG_TASK
struct notification *com = pool_alloc(pool_head_notification);
if (!com)
return NULL;
- LIST_ADDQ(purge, &com->purge_me);
- LIST_ADDQ(event, &com->wake_me);
+ LIST_APPEND(purge, &com->purge_me);
+ LIST_APPEND(event, &com->wake_me);
HA_SPIN_INIT(&com->lock);
com->task = wakeup;
return com;
/* Delete all pending communication signals. */
list_for_each_entry_safe(com, back, purge, purge_me) {
HA_SPIN_LOCK(NOTIF_LOCK, &com->lock);
- LIST_DEL(&com->purge_me);
+ LIST_DELETE(&com->purge_me);
if (!com->task) {
HA_SPIN_UNLOCK(NOTIF_LOCK, &com->lock);
pool_free(pool_head_notification, com);
list_for_each_entry_safe (com, back, purge, purge_me) {
if (com->task)
continue;
- LIST_DEL(&com->purge_me);
+ LIST_DELETE(&com->purge_me);
pool_free(pool_head_notification, com);
}
}
/* Wake task and delete all pending communication signals. */
list_for_each_entry_safe(com, back, wake, wake_me) {
HA_SPIN_LOCK(NOTIF_LOCK, &com->lock);
- LIST_DEL(&com->wake_me);
+ LIST_DELETE(&com->wake_me);
if (!com->task) {
HA_SPIN_UNLOCK(NOTIF_LOCK, &com->lock);
pool_free(pool_head_notification, com);
/* adds list item <item> to work list <work> and wake up the associated task */
static inline void work_list_add(struct work_list *work, struct mt_list *item)
{
- MT_LIST_TRY_ADDQ(&work->head, item);
+ MT_LIST_TRY_APPEND(&work->head, item);
task_wakeup(work->task, TASK_WOKEN_OTHER);
}
static inline void tcp_check_keywords_register(struct action_kw_list *kw_list)
{
- LIST_ADDQ(&tcp_check_keywords.list, &kw_list->list);
+ LIST_APPEND(&tcp_check_keywords.list, &kw_list->list);
}
#endif /* _HAPROXY_TCPCHECK_H */
source->sink = NULL;
source->state = TRACE_STATE_STOPPED;
source->lockon_ptr = NULL;
- LIST_ADDQ(&trace_sources, &source->source_link);
+ LIST_APPEND(&trace_sources, &source->source_link);
}
#endif /* _HAPROXY_TRACE_H */
pkt = eb64_entry(&node->node, struct quic_tx_packet, pn_node);
node = eb64_next(node);
list_for_each_entry_safe(frm, frmbak, &pkt->frms, list) {
- LIST_DEL(&frm->list);
+ LIST_DELETE(&frm->list);
pool_free(pool_head_quic_tx_frm, frm);
}
eb64_delete(&pkt->pn_node);
static inline void quic_rx_packet_list_addq(struct list *list,
struct quic_rx_packet *pkt)
{
- LIST_ADDQ(list, &pkt->list);
+ LIST_APPEND(list, &pkt->list);
quic_rx_packet_refinc(pkt);
}
/* Remove <pkt> RX packet from <list>, decrementing its reference counter. */
static inline void quic_rx_packet_list_del(struct quic_rx_packet *pkt)
{
- LIST_DEL(&pkt->list);
+ LIST_DELETE(&pkt->list);
quic_rx_packet_refdec(pkt);
}
*/
void acl_register_keywords(struct acl_kw_list *kwl)
{
- LIST_ADDQ(&acl_keywords.list, &kwl->list);
+ LIST_APPEND(&acl_keywords.list, &kwl->list);
}
/*
*/
void acl_unregister_keywords(struct acl_kw_list *kwl)
{
- LIST_DEL(&kwl->list);
+ LIST_DELETE(&kwl->list);
LIST_INIT(&kwl->list);
}
if (!conv_expr)
goto out_free_smp;
- LIST_ADDQ(&(smp->conv_exprs), &(conv_expr->list));
+ LIST_APPEND(&(smp->conv_exprs), &(conv_expr->list));
conv_expr->conv = conv;
acl_conv_found = 1;
free(acl->name);
list_for_each_entry_safe(expr, exprb, &acl->expr, list) {
- LIST_DEL(&expr->list);
+ LIST_DELETE(&expr->list);
prune_acl_expr(expr);
free(expr);
}
}
LIST_INIT(&cur_acl->expr);
- LIST_ADDQ(known_acl, &cur_acl->list);
+ LIST_APPEND(known_acl, &cur_acl->list);
cur_acl->name = name;
}
*/
cur_acl->use |= acl_expr->smp->fetch->use;
cur_acl->val |= acl_expr->smp->fetch->val;
- LIST_ADDQ(&cur_acl->expr, &acl_expr->list);
+ LIST_APPEND(&cur_acl->expr, &acl_expr->list);
return cur_acl;
out_free_name:
cur_acl->use |= acl_expr->smp->fetch->use;
cur_acl->val |= acl_expr->smp->fetch->val;
LIST_INIT(&cur_acl->expr);
- LIST_ADDQ(&cur_acl->expr, &acl_expr->list);
+ LIST_APPEND(&cur_acl->expr, &acl_expr->list);
if (known_acl)
- LIST_ADDQ(known_acl, &cur_acl->list);
+ LIST_APPEND(known_acl, &cur_acl->list);
return cur_acl;
goto out_free_term;
}
LIST_INIT(&cur_suite->terms);
- LIST_ADDQ(&cond->suites, &cur_suite->list);
+ LIST_APPEND(&cond->suites, &cur_suite->list);
}
- LIST_ADDQ(&cur_suite->terms, &cur_term->list);
+ LIST_APPEND(&cur_suite->terms, &cur_term->list);
neg = 0;
}
list_for_each_entry_safe(suite, suiteb, &cond->suites, list) {
list_for_each_entry_safe(term, termb, &suite->terms, list) {
- LIST_DEL(&term->list);
+ LIST_DELETE(&term->list);
free(term);
}
- LIST_DEL(&suite->list);
+ LIST_DELETE(&suite->list);
free(suite);
}
struct act_rule *rule, *ruleb;
list_for_each_entry_safe(rule, ruleb, rules, list) {
- LIST_DEL(&rule->list);
+ LIST_DELETE(&rule->list);
free_acl_cond(rule->cond);
if (rule->release_ptr)
rule->release_ptr(rule);
if (new) {
new->arg = arg;
new->arg_pos = pos;
- LIST_ADDQ(&orig->list, &new->list);
+ LIST_APPEND(&orig->list, &new->list);
}
return new;
}
if (tokill_conn) {
/* We got one, put it into the concerned thread's to kill list, and wake it's kill task */
- MT_LIST_ADDQ(&idle_conns[i].toremove_conns,
+ MT_LIST_APPEND(&idle_conns[i].toremove_conns,
(struct mt_list *)&tokill_conn->toremove_list);
task_wakeup(idle_conns[i].cleanup_task, TASK_WOKEN_OTHER);
break;
fconf->id = cache_store_flt_id;
fconf->conf = cconf;
fconf->ops = &cache_ops;
- LIST_ADDQ(&proxy->filter_configs, &fconf->list);
+ LIST_APPEND(&proxy->filter_configs, &fconf->list);
rule->arg.act.p[0] = cconf;
return 1;
/* add to the list of cache to init and reinit tmp_cache_config
* for next cache section, if any.
*/
- LIST_ADDQ(&caches_config, &tmp_cache_config->list);
+ LIST_APPEND(&caches_config, &tmp_cache_config->list);
tmp_cache_config = NULL;
return err_code;
}
memcpy(shctx->data, cache_config, sizeof(struct cache));
cache = (struct cache *)shctx->data;
cache->entries = EB_ROOT;
- LIST_ADDQ(&caches, &cache->list);
- LIST_DEL(&cache_config->list);
+ LIST_APPEND(&caches, &cache->list);
+ LIST_DELETE(&cache_config->list);
free(cache_config);
/* Find all references for this cache in the existing filters
}
/* Remove the implicit filter. <cconf> is kept for the explicit one */
- LIST_DEL(&f->list);
+ LIST_DELETE(&f->list);
free(f);
free(name);
break;
(curproxy->cap & PR_CAP_FE) ? SMP_VAL_FE_HRQ_HDR : SMP_VAL_BE_HRQ_HDR,
file, linenum);
- LIST_ADDQ(&curproxy->http_req_rules, &rule->list);
+ LIST_APPEND(&curproxy->http_req_rules, &rule->list);
}
else if (strcmp(args[0], "http-response") == 0) { /* response access control */
struct act_rule *rule;
(curproxy->cap & PR_CAP_BE) ? SMP_VAL_BE_HRS_HDR : SMP_VAL_FE_HRS_HDR,
file, linenum);
- LIST_ADDQ(&curproxy->http_res_rules, &rule->list);
+ LIST_APPEND(&curproxy->http_res_rules, &rule->list);
}
else if (strcmp(args[0], "http-after-response") == 0) {
struct act_rule *rule;
(curproxy->cap & PR_CAP_BE) ? SMP_VAL_BE_HRS_HDR : SMP_VAL_FE_HRS_HDR,
file, linenum);
- LIST_ADDQ(&curproxy->http_after_res_rules, &rule->list);
+ LIST_APPEND(&curproxy->http_after_res_rules, &rule->list);
}
else if (strcmp(args[0], "http-send-name-header") == 0) { /* send server name in request header */
/* set the header name and length into the proxy structure */
goto out;
}
- LIST_ADDQ(&curproxy->redirect_rules, &rule->list);
+ LIST_APPEND(&curproxy->redirect_rules, &rule->list);
err_code |= warnif_misplaced_redirect(curproxy, file, linenum, args[0]);
err_code |= warnif_cond_conflicts(rule->cond,
(curproxy->cap & PR_CAP_FE) ? SMP_VAL_FE_HRQ_HDR : SMP_VAL_BE_HRQ_HDR,
goto alloc_error;
}
LIST_INIT(&rule->list);
- LIST_ADDQ(&curproxy->switching_rules, &rule->list);
+ LIST_APPEND(&curproxy->switching_rules, &rule->list);
}
else if (strcmp(args[0], "use-server") == 0) {
struct server_rule *rule;
goto alloc_error;
}
LIST_INIT(&rule->list);
- LIST_ADDQ(&curproxy->server_rules, &rule->list);
+ LIST_APPEND(&curproxy->server_rules, &rule->list);
curproxy->be_req_ana |= AN_REQ_SRV_RULES;
}
else if ((strcmp(args[0], "force-persist") == 0) ||
rule->type = PERSIST_TYPE_IGNORE;
}
LIST_INIT(&rule->list);
- LIST_ADDQ(&curproxy->persist_rules, &rule->list);
+ LIST_APPEND(&curproxy->persist_rules, &rule->list);
}
else if (strcmp(args[0], "stick-table") == 0) {
struct stktable *other;
rule->table.name = name ? strdup(name) : NULL;
LIST_INIT(&rule->list);
if (flags & STK_ON_RSP)
- LIST_ADDQ(&curproxy->storersp_rules, &rule->list);
+ LIST_APPEND(&curproxy->storersp_rules, &rule->list);
else
- LIST_ADDQ(&curproxy->sticking_rules, &rule->list);
+ LIST_APPEND(&curproxy->sticking_rules, &rule->list);
}
else if (strcmp(args[0], "stats") == 0) {
if (!(curproxy->cap & PR_CAP_DEF) && curproxy->uri_auth == curr_defproxy->uri_auth)
}
rule->cond = cond;
LIST_INIT(&rule->list);
- LIST_ADDQ(&curproxy->uri_auth->admin_rules, &rule->list);
+ LIST_APPEND(&curproxy->uri_auth->admin_rules, &rule->list);
} else if (strcmp(args[1], "uri") == 0) {
if (*(args[2]) == 0) {
ha_alert("parsing [%s:%d] : 'uri' needs an URI prefix.\n", file, linenum);
err_code |= warnif_cond_conflicts(rule->cond,
(curproxy->cap & PR_CAP_FE) ? SMP_VAL_FE_HRQ_HDR : SMP_VAL_BE_HRQ_HDR,
file, linenum);
- LIST_ADDQ(&curproxy->uri_auth->http_req_rules, &rule->list);
+ LIST_APPEND(&curproxy->uri_auth->http_req_rules, &rule->list);
} else if (strcmp(args[1], "auth") == 0) {
if (*(args[2]) == 0) {
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
- LIST_ADDQ(&curproxy->mon_fail_cond, &cond->list);
+ LIST_APPEND(&curproxy->mon_fail_cond, &cond->list);
}
else {
ha_alert("parsing [%s:%d] : '%s' only supports 'fail'.\n", file, linenum, args[0]);
HA_RWLOCK_INIT(&keys_ref->lock);
conf->keys_ref = keys_ref;
- LIST_ADD(&tlskeys_reference, &keys_ref->list);
+ LIST_INSERT(&tlskeys_reference, &keys_ref->list);
return 0;
/* Only one element in the list, a simple string: free the expression and
* fall back to static rule
*/
- LIST_DEL(&node->list);
+ LIST_DELETE(&node->list);
free(node->arg);
free(node);
}
/* Only one element in the list, a simple string: free the expression and
* fall back to static rule
*/
- LIST_DEL(&node->list);
+ LIST_DELETE(&node->list);
free(node->arg);
free(node);
}
break;
}
- LIST_ADDQ(&curproxy->uri_auth->http_req_rules, &rule->list);
+ LIST_APPEND(&curproxy->uri_auth->http_req_rules, &rule->list);
if (curproxy->uri_auth->auth_realm) {
ha_free(&curproxy->uri_auth->auth_realm);
*/
void cfg_register_keywords(struct cfg_kw_list *kwl)
{
- LIST_ADDQ(&cfg_keywords.list, &kwl->list);
+ LIST_APPEND(&cfg_keywords.list, &kwl->list);
}
/*
*/
void cfg_unregister_keywords(struct cfg_kw_list *kwl)
{
- LIST_DEL(&kwl->list);
+ LIST_DELETE(&kwl->list);
LIST_INIT(&kwl->list);
}
cs->section_parser = section_parser;
cs->post_section_parser = post_section_parser;
- LIST_ADDQ(§ions, &cs->list);
+ LIST_APPEND(§ions, &cs->list);
return 1;
}
cp->name = name;
cp->func = func;
- LIST_ADDQ(&postparsers, &cp->list);
+ LIST_APPEND(&postparsers, &cp->list);
return 1;
}
struct cfg_section *cs, *ics;
list_for_each_entry_safe(cs, ics, §ions, list) {
- LIST_DEL(&cs->list);
+ LIST_DELETE(&cs->list);
free(cs);
}
}
struct cfg_section *cs, *ics;
list_for_each_entry_safe(cs, ics, §ions, list) {
- LIST_DEL(&cs->list);
- LIST_ADDQ(backup_sections, &cs->list);
+ LIST_DELETE(&cs->list);
+ LIST_APPEND(backup_sections, &cs->list);
}
}
struct cfg_section *cs, *ics;
list_for_each_entry_safe(cs, ics, backup_sections, list) {
- LIST_DEL(&cs->list);
- LIST_ADDQ(§ions, &cs->list);
+ LIST_DELETE(&cs->list);
+ LIST_APPEND(§ions, &cs->list);
}
}
{
struct buffer *buf = NULL;
- if (likely(!LIST_ADDED(&check->buf_wait.list)) &&
+ if (likely(!LIST_INLIST(&check->buf_wait.list)) &&
unlikely((buf = b_alloc(bptr)) == NULL)) {
check->buf_wait.target = check;
check->buf_wait.wakeup_cb = check_buf_available;
- LIST_ADDQ(&ti->buffer_wq, &check->buf_wait.list);
+ LIST_APPEND(&ti->buffer_wq, &check->buf_wait.list);
}
return buf;
}
}
chk->action = TCPCHK_ACT_CONNECT;
chk->connect.options = (TCPCHK_OPT_DEFAULT_CONNECT|TCPCHK_OPT_IMPLICIT);
- LIST_ADD(srv->agent.tcpcheck_rules->list, &chk->list);
+ LIST_INSERT(srv->agent.tcpcheck_rules->list, &chk->list);
}
goto error;
}
chk->index = 0;
- LIST_ADDQ(&rs->rules, &chk->list);
+ LIST_APPEND(&rs->rules, &chk->list);
chk = parse_tcpcheck_expect((char *[]){"tcp-check", "expect", "custom", ""},
1, curpx, &rs->rules, TCPCHK_RULES_AGENT_CHK,
}
chk->expect.custom = tcpcheck_agent_expect_reply;
chk->index = 1;
- LIST_ADDQ(&rs->rules, &chk->list);
+ LIST_APPEND(&rs->rules, &chk->list);
ruleset_found:
rules->list = &rs->rules;
var->data.u.str.area = str;
var->data.u.str.data = strlen(str);
LIST_INIT(&var->list);
- LIST_ADDQ(&rules->preset_vars, &var->list);
+ LIST_APPEND(&rules->preset_vars, &var->list);
return 1;
void cli_register_kw(struct cli_kw_list *kw_list)
{
- LIST_ADDQ(&cli_keywords.list, &kw_list->list);
+ LIST_APPEND(&cli_keywords.list, &kw_list->list);
}
* so we can add if to free_sess list
* to receive a new request
*/
- LIST_ADD(&ds->dss->free_sess, &ds->list);
+ LIST_INSERT(&ds->dss->free_sess, &ds->list);
}
else {
/* there is no more pipelined requests
* into this session, so we move it
* to idle_sess list */
- LIST_ADD(&ds->dss->idle_sess, &ds->list);
+ LIST_INSERT(&ds->dss->idle_sess, &ds->list);
/* update the counter of idle sessions */
ds->dss->idle_conns++;
* to destroy the task */
task_queue(ds->task_exp);
}
- LIST_ADDQ(&ds->queries, &query->list);
+ LIST_APPEND(&ds->queries, &query->list);
eb32_insert(&ds->query_ids, &query->qid);
ds->onfly_queries++;
}
if (ret) {
/* let's be woken up once new request to write arrived */
HA_RWLOCK_WRLOCK(DNS_LOCK, &ring->lock);
- LIST_ADDQ(&ring->waiters, &appctx->wait_entry);
+ LIST_APPEND(&ring->waiters, &appctx->wait_entry);
HA_RWLOCK_WRUNLOCK(DNS_LOCK, &ring->lock);
si_rx_endp_done(si);
}
* delete from the list
*/
__ha_barrier_load();
- if (!LIST_ADDED(&ds->waiter)) {
+ if (!LIST_INLIST(&ds->waiter)) {
while (1) {
uint16_t query_id;
struct eb32_node *eb;
/* remove query ids mapping from pending queries list/tree */
eb32_delete(&query->qid);
- LIST_DEL(&query->list);
+ LIST_DELETE(&query->list);
pool_free(dns_query_pool, query);
ds->onfly_queries--;
* wait_sess list where the task processing
* response will pop available responses
*/
- LIST_ADDQ(&ds->dss->wait_sess, &ds->waiter);
+ LIST_APPEND(&ds->dss->wait_sess, &ds->waiter);
/* lock the dns_stream_server containing lists heads */
HA_SPIN_UNLOCK(DNS_LOCK, &ds->dss->lock);
break;
}
- if (!LIST_ADDED(&ds->waiter)) {
+ if (!LIST_INLIST(&ds->waiter)) {
/* there is no more pending data to read and the con was closed by the server side */
if (!co_data(si_oc(si)) && (si_oc(si)->flags & CF_SHUTW)) {
goto close;
list_for_each_entry_safe(query, queryb, &ds->queries, list) {
eb32_delete(&query->qid);
- LIST_DEL(&query->list);
+ LIST_DELETE(&query->list);
pool_free(dns_query_pool, query);
}
}
* message offsets if the session
* was closed with an incomplete pending response
*/
- if (!LIST_ADDED(&ds->waiter))
+ if (!LIST_INLIST(&ds->waiter))
ds->rx_msg.len = ds->rx_msg.offset = 0;
/* we flush pending sent queries because we never
}
if (ds->nb_queries < DNS_STREAM_MAX_PIPELINED_REQ)
- LIST_ADD(&ds->dss->free_sess, &ds->list);
+ LIST_INSERT(&ds->dss->free_sess, &ds->list);
HA_SPIN_UNLOCK(DNS_LOCK, &dss->lock);
}
/* Error unrolling */
out_free_strm:
- LIST_DEL(&s->list);
+ LIST_DELETE(&s->list);
pool_free(pool_head_stream, s);
out_free_sess:
session_free(sess);
list_for_each_entry_safe(query, queryb, &ds->queries, list) {
if (tick_is_expired(query->expire, now_ms)) {
eb32_delete(&query->qid);
- LIST_DEL(&query->list);
+ LIST_DELETE(&query->list);
pool_free(dns_query_pool, query);
ds->onfly_queries--;
}
* it may be close to be full so we put it at the end
* of free conn list */
LIST_DEL_INIT(&ds->list);
- LIST_ADDQ(&dss->free_sess, &ds->list);
+ LIST_APPEND(&dss->free_sess, &ds->list);
}
}
* this request, this request may be large and fill
* the ring buffer so we prefer to put at the end of free
* list. */
- LIST_ADDQ(&dss->free_sess, &ds->list);
+ LIST_APPEND(&dss->free_sess, &ds->list);
ads = ds;
}
}
/* ring is empty so this ring_write should never fail */
ring_write(&ads->ring, DNS_TCP_MSG_MAX_SIZE, NULL, 0, &myist, 1);
ads->nb_queries++;
- LIST_ADD(&dss->free_sess, &ads->list);
+ LIST_INSERT(&dss->free_sess, &ads->list);
}
else
ns->counters->snd_error++;
LIST_INIT(&elem->list);
HA_SPIN_LOCK(PID_LIST_LOCK, &pid_list_lock);
- LIST_ADD(&pid_list, &elem->list);
+ LIST_INSERT(&pid_list, &elem->list);
HA_SPIN_UNLOCK(PID_LIST_LOCK, &pid_list_lock);
return elem;
return;
HA_SPIN_LOCK(PID_LIST_LOCK, &pid_list_lock);
- LIST_DEL(&elem->list);
+ LIST_DELETE(&elem->list);
HA_SPIN_UNLOCK(PID_LIST_LOCK, &pid_list_lock);
if (!elem->exited)
struct logformat_node *lf, *lfb;
list_for_each_entry_safe(lf, lfb, &rule->value, list) {
- LIST_DEL(&lf->list);
+ LIST_DELETE(&lf->list);
release_sample_expr(lf->expr);
free(lf->arg);
free(lf);
free(fcgi_conf->name);
list_for_each_entry_safe(rule, back, &fcgi_conf->param_rules, list) {
- LIST_DEL(&rule->list);
+ LIST_DELETE(&rule->list);
fcgi_release_rule(rule);
}
list_for_each_entry_safe(rule, back, &fcgi_conf->hdr_rules, list) {
- LIST_DEL(&rule->list);
+ LIST_DELETE(&rule->list);
fcgi_release_rule(rule);
}
}
if (rule->type == FCGI_RULE_SET_PARAM || rule->type == FCGI_RULE_UNSET_PARAM)
- LIST_ADDQ(&fcgi_conf->param_rules, &rule->list);
+ LIST_APPEND(&fcgi_conf->param_rules, &rule->list);
else /* FCGI_RULE_PASS_HDR/FCGI_RULE_HIDE_HDR */
- LIST_ADDQ(&fcgi_conf->hdr_rules, &rule->list);
+ LIST_APPEND(&fcgi_conf->hdr_rules, &rule->list);
rule = NULL;
}
return 0;
}
/* Place the filter at its right position */
- LIST_DEL(&f->list);
+ LIST_DELETE(&f->list);
free(f);
ha_free(&name);
break;
fconf->id = fcgi_flt_id;
fconf->conf = fcgi_conf;
fconf->ops = &fcgi_flt_ops;
- LIST_ADDQ(&curpx->filter_configs, &fconf->list);
+ LIST_APPEND(&curpx->filter_configs, &fconf->list);
end:
return retval;
goto err;
}
rule->cond = cond;
- LIST_ADDQ(&curapp->conf.rules, &rule->list);
+ LIST_APPEND(&curapp->conf.rules, &rule->list);
return 1;
err:
free(curapp->conf.file);
list_for_each_entry_safe(log, logb, &curapp->logsrvs, list) {
- LIST_DEL(&log->list);
+ LIST_DELETE(&log->list);
free(log);
}
list_for_each_entry_safe(rule, back, &curapp->conf.rules, list) {
- LIST_DEL(&rule->list);
+ LIST_DELETE(&rule->list);
fcgi_release_rule_conf(rule);
}
void
flt_register_keywords(struct flt_kw_list *kwl)
{
- LIST_ADDQ(&flt_keywords.list, &kwl->list);
+ LIST_APPEND(&flt_keywords.list, &kwl->list);
}
/*
goto error;
}
- LIST_ADDQ(&curpx->filter_configs, &fconf->list);
+ LIST_APPEND(&curpx->filter_configs, &fconf->list);
}
return 0;
list_for_each_entry_safe(fconf, back, &proxy->filter_configs, list) {
if (fconf->ops->deinit)
fconf->ops->deinit(proxy, fconf);
- LIST_DEL(&fconf->list);
+ LIST_DELETE(&fconf->list);
free(fconf);
}
}
}
}
- LIST_ADDQ(&strm_flt(s)->filters, &f->list);
+ LIST_APPEND(&strm_flt(s)->filters, &f->list);
strm_flt(s)->flags |= STRM_FLT_FL_HAS_FILTERS;
return 0;
}
if (!only_backend || (filter->flags & FLT_FL_IS_BACKEND_FILTER)) {
if (FLT_OPS(filter)->detach)
FLT_OPS(filter)->detach(s, filter);
- LIST_DEL(&filter->list);
+ LIST_DELETE(&filter->list);
pool_free(pool_head_filter, filter);
}
}
fconf->id = http_comp_flt_id;
fconf->conf = NULL;
fconf->ops = &comp_ops;
- LIST_ADDQ(&proxy->filter_configs, &fconf->list);
+ LIST_APPEND(&proxy->filter_configs, &fconf->list);
end:
return err;
}
list_for_each_entry_safe(arg, argback, &msg->args, list) {
release_sample_expr(arg->expr);
free(arg->name);
- LIST_DEL(&arg->list);
+ LIST_DELETE(&arg->list);
free(arg);
}
list_for_each_entry_safe(acl, aclback, &msg->acls, list) {
- LIST_DEL(&acl->list);
+ LIST_DELETE(&acl->list);
prune_acl(acl);
free(acl);
}
free(agent->var_t_process);
free(agent->var_t_total);
list_for_each_entry_safe(msg, msgback, &agent->messages, list) {
- LIST_DEL(&msg->list);
+ LIST_DELETE(&msg->list);
spoe_release_message(msg);
}
list_for_each_entry_safe(grp, grpback, &agent->groups, list) {
- LIST_DEL(&grp->list);
+ LIST_DELETE(&grp->list);
spoe_release_group(grp);
}
if (agent->rt) {
_HA_ATOMIC_DEC(&agent->counters.applets);
HA_SPIN_LOCK(SPOE_APPLET_LOCK, &agent->rt[tid].lock);
if (!LIST_ISEMPTY(&spoe_appctx->list)) {
- LIST_DEL(&spoe_appctx->list);
+ LIST_DELETE(&spoe_appctx->list);
LIST_INIT(&spoe_appctx->list);
}
HA_SPIN_UNLOCK(SPOE_APPLET_LOCK, &agent->rt[tid].lock);
/* Notify all waiting streams */
list_for_each_entry_safe(ctx, back, &spoe_appctx->waiting_queue, list) {
- LIST_DEL(&ctx->list);
+ LIST_DELETE(&ctx->list);
LIST_INIT(&ctx->list);
_HA_ATOMIC_DEC(&agent->counters.nb_waiting);
spoe_update_stat_time(&ctx->stats.tv_wait, &ctx->stats.t_waiting);
/* If this was the last running applet, notify all waiting streams */
list_for_each_entry_safe(ctx, back, &agent->rt[tid].sending_queue, list) {
- LIST_DEL(&ctx->list);
+ LIST_DELETE(&ctx->list);
LIST_INIT(&ctx->list);
_HA_ATOMIC_DEC(&agent->counters.nb_sending);
spoe_update_stat_time(&ctx->stats.tv_queue, &ctx->stats.t_queue);
task_wakeup(ctx->strm->task, TASK_WOKEN_MSG);
}
list_for_each_entry_safe(ctx, back, &agent->rt[tid].waiting_queue, list) {
- LIST_DEL(&ctx->list);
+ LIST_DELETE(&ctx->list);
LIST_INIT(&ctx->list);
_HA_ATOMIC_DEC(&agent->counters.nb_waiting);
spoe_update_stat_time(&ctx->stats.tv_wait, &ctx->stats.t_waiting);
goto abort_frag_frame;
spoe_release_buffer(&ctx->buffer, &ctx->buffer_wait);
- LIST_DEL(&ctx->list);
+ LIST_DELETE(&ctx->list);
LIST_INIT(&ctx->list);
_HA_ATOMIC_DEC(&agent->counters.nb_sending);
spoe_update_stat_time(&ctx->stats.tv_queue, &ctx->stats.t_queue);
goto abort_frag_frame;
spoe_release_buffer(&ctx->buffer, &ctx->buffer_wait);
- LIST_DEL(&ctx->list);
+ LIST_DELETE(&ctx->list);
LIST_INIT(&ctx->list);
_HA_ATOMIC_DEC(&agent->counters.nb_sending);
spoe_update_stat_time(&ctx->stats.tv_queue, &ctx->stats.t_queue);
no_frag_frame_sent:
if (SPOE_APPCTX(appctx)->flags & SPOE_APPCTX_FL_ASYNC) {
appctx->st0 = SPOE_APPCTX_ST_PROCESSING;
- LIST_ADDQ(&agent->rt[tid].waiting_queue, &ctx->list);
+ LIST_APPEND(&agent->rt[tid].waiting_queue, &ctx->list);
}
else if (SPOE_APPCTX(appctx)->flags & SPOE_APPCTX_FL_PIPELINING) {
appctx->st0 = SPOE_APPCTX_ST_PROCESSING;
- LIST_ADDQ(&SPOE_APPCTX(appctx)->waiting_queue, &ctx->list);
+ LIST_APPEND(&SPOE_APPCTX(appctx)->waiting_queue, &ctx->list);
}
else {
appctx->st0 = SPOE_APPCTX_ST_WAITING_SYNC_ACK;
*skip = 1;
- LIST_ADDQ(&SPOE_APPCTX(appctx)->waiting_queue, &ctx->list);
+ LIST_APPEND(&SPOE_APPCTX(appctx)->waiting_queue, &ctx->list);
}
_HA_ATOMIC_INC(&agent->counters.nb_waiting);
ctx->stats.tv_wait = now;
break;
default:
- LIST_DEL(&ctx->list);
+ LIST_DELETE(&ctx->list);
LIST_INIT(&ctx->list);
_HA_ATOMIC_DEC(&agent->counters.nb_waiting);
spoe_update_stat_time(&ctx->stats.tv_wait, &ctx->stats.t_waiting);
strm->res.flags |= CF_READ_DONTWAIT;
HA_SPIN_LOCK(SPOE_APPLET_LOCK, &conf->agent->rt[tid].lock);
- LIST_ADDQ(&conf->agent->rt[tid].applets, &SPOE_APPCTX(appctx)->list);
+ LIST_APPEND(&conf->agent->rt[tid].applets, &SPOE_APPCTX(appctx)->list);
HA_SPIN_UNLOCK(SPOE_APPLET_LOCK, &conf->agent->rt[tid].lock);
_HA_ATOMIC_INC(&conf->agent->counters.applets);
ctx->stats.tv_queue = now;
if (ctx->spoe_appctx)
return 1;
- LIST_ADDQ(&agent->rt[tid].sending_queue, &ctx->list);
+ LIST_APPEND(&agent->rt[tid].sending_queue, &ctx->list);
SPOE_PRINTF(stderr, "%d.%06d [SPOE/%-15s] %s: stream=%p"
" - Add stream in sending queue"
else
_HA_ATOMIC_DEC(&agent->counters.nb_waiting);
- LIST_DEL(&ctx->list);
+ LIST_DELETE(&ctx->list);
LIST_INIT(&ctx->list);
}
}
if (buf->size)
return 1;
- if (LIST_ADDED(&buffer_wait->list))
+ if (LIST_INLIST(&buffer_wait->list))
LIST_DEL_INIT(&buffer_wait->list);
if (b_alloc(buf))
return 1;
- LIST_ADDQ(&ti->buffer_wq, &buffer_wait->list);
+ LIST_APPEND(&ti->buffer_wq, &buffer_wait->list);
return 0;
}
static void
spoe_release_buffer(struct buffer *buf, struct buffer_wait *buffer_wait)
{
- if (LIST_ADDED(&buffer_wait->list))
+ if (LIST_INLIST(&buffer_wait->list))
LIST_DEL_INIT(&buffer_wait->list);
/* Release the buffer if needed */
goto out;
}
ph->id = strdup(args[cur_arg]);
- LIST_ADDQ(&curmphs, &ph->list);
+ LIST_APPEND(&curmphs, &ph->list);
cur_arg++;
}
}
goto out;
}
ph->id = strdup(args[cur_arg]);
- LIST_ADDQ(&curgphs, &ph->list);
+ LIST_APPEND(&curgphs, &ph->list);
cur_arg++;
}
}
err_code |= ERR_ALERT | ERR_ABORT;
goto out;
}
- LIST_ADDQ(&curvars, &vph->list);
+ LIST_APPEND(&curvars, &vph->list);
cur_arg++;
}
}
curgrp->conf.line = linenum;
LIST_INIT(&curgrp->phs);
LIST_INIT(&curgrp->messages);
- LIST_ADDQ(&curgrps, &curgrp->list);
+ LIST_APPEND(&curgrps, &curgrp->list);
}
else if (strcmp(args[0], "messages") == 0) {
int cur_arg = 1;
goto out;
}
ph->id = strdup(args[cur_arg]);
- LIST_ADDQ(&curgrp->phs, &ph->list);
+ LIST_APPEND(&curgrp->phs, &ph->list);
cur_arg++;
}
}
LIST_INIT(&curmsg->acls);
LIST_INIT(&curmsg->by_evt);
LIST_INIT(&curmsg->by_grp);
- LIST_ADDQ(&curmsgs, &curmsg->list);
+ LIST_APPEND(&curmsgs, &curmsg->list);
}
else if (strcmp(args[0], "args") == 0) {
int cur_arg = 1;
goto out;
}
curmsg->nargs++;
- LIST_ADDQ(&curmsg->args, &arg->list);
+ LIST_APPEND(&curmsg->args, &arg->list);
cur_arg++;
}
curproxy->conf.args.file = NULL;
}
msg->agent = curagent;
- LIST_ADDQ(&curagent->events[msg->event], &msg->by_evt);
+ LIST_APPEND(&curagent->events[msg->event], &msg->by_evt);
goto next_mph;
}
}
list_for_each_entry_safe(grp, grpback, &curgrps, list) {
if (strcmp(grp->id, ph->id) == 0) {
grp->agent = curagent;
- LIST_DEL(&grp->list);
- LIST_ADDQ(&curagent->groups, &grp->list);
+ LIST_DELETE(&grp->list);
+ LIST_APPEND(&curagent->groups, &grp->list);
goto next_aph;
}
}
* them only if a rule use the corresponding SPOE group. */
msg->agent = curagent;
msg->group = grp;
- LIST_DEL(&ph->list);
- LIST_ADDQ(&grp->messages, &msg->by_grp);
+ LIST_DELETE(&ph->list);
+ LIST_APPEND(&grp->messages, &msg->by_grp);
goto next_mph_grp;
}
}
conf->agent_fe.options2 |= curpxopts2;
list_for_each_entry_safe(logsrv, logsrvback, &curlogsrvs, list) {
- LIST_DEL(&logsrv->list);
- LIST_ADDQ(&conf->agent_fe.logsrvs, &logsrv->list);
+ LIST_DELETE(&logsrv->list);
+ LIST_APPEND(&conf->agent_fe.logsrvs, &logsrv->list);
}
list_for_each_entry_safe(ph, phback, &curmphs, list) {
- LIST_DEL(&ph->list);
+ LIST_DELETE(&ph->list);
spoe_release_placeholder(ph);
}
list_for_each_entry_safe(ph, phback, &curgphs, list) {
- LIST_DEL(&ph->list);
+ LIST_DELETE(&ph->list);
spoe_release_placeholder(ph);
}
list_for_each_entry_safe(vph, vphback, &curvars, list) {
goto error;
}
- LIST_DEL(&vph->list);
+ LIST_DELETE(&vph->list);
free(vph->name);
free(vph);
}
list_for_each_entry_safe(grp, grpback, &curgrps, list) {
- LIST_DEL(&grp->list);
+ LIST_DELETE(&grp->list);
spoe_release_group(grp);
}
*cur_arg = pos;
error:
spoe_release_agent(curagent);
list_for_each_entry_safe(ph, phback, &curmphs, list) {
- LIST_DEL(&ph->list);
+ LIST_DELETE(&ph->list);
spoe_release_placeholder(ph);
}
list_for_each_entry_safe(ph, phback, &curgphs, list) {
- LIST_DEL(&ph->list);
+ LIST_DELETE(&ph->list);
spoe_release_placeholder(ph);
}
list_for_each_entry_safe(vph, vphback, &curvars, list) {
- LIST_DEL(&vph->list);
+ LIST_DELETE(&vph->list);
free(vph->name);
free(vph);
}
list_for_each_entry_safe(grp, grpback, &curgrps, list) {
- LIST_DEL(&grp->list);
+ LIST_DELETE(&grp->list);
spoe_release_group(grp);
}
list_for_each_entry_safe(msg, msgback, &curmsgs, list) {
- LIST_DEL(&msg->list);
+ LIST_DELETE(&msg->list);
spoe_release_message(msg);
}
list_for_each_entry_safe(logsrv, logsrvback, &curlogsrvs, list) {
- LIST_DEL(&logsrv->list);
+ LIST_DELETE(&logsrv->list);
free(logsrv);
}
free(conf);
}
b->str = str;
b->must_free = must_free;
- LIST_ADDQ(&build_opts_list, &b->list);
+ LIST_APPEND(&build_opts_list, &b->list);
}
static void display_version()
/* remove the current directory (wl) from cfg_cfgfiles */
free(wl->s);
- LIST_DEL(&wl->list);
+ LIST_DELETE(&wl->list);
free(wl);
}
ha_alert("Cannot allocate memory\n");
exit(EXIT_FAILURE);
}
- LIST_ADD(&mworker_cli_conf, &c->list);
+ LIST_INSERT(&mworker_cli_conf, &c->list);
argv++;
argc--;
proc_self = tmproc;
- LIST_ADDQ(&proc_list, &tmproc->list);
+ LIST_APPEND(&proc_list, &tmproc->list);
}
for (proc = 0; proc < global.nbproc; proc++) {
exit(EXIT_FAILURE);
}
- LIST_ADDQ(&proc_list, &tmproc->list);
+ LIST_APPEND(&proc_list, &tmproc->list);
}
}
if (global.mode & (MODE_MWORKER|MODE_MWORKER_WAIT)) {
ha_alert("Can't create the master's CLI.\n");
exit(EXIT_FAILURE);
}
- LIST_DEL(&c->list);
+ LIST_DELETE(&c->list);
free(c->s);
free(c);
}
idle_conn_task = NULL;
list_for_each_entry_safe(log, logb, &global.logsrvs, list) {
- LIST_DEL(&log->list);
+ LIST_DELETE(&log->list);
free(log);
}
list_for_each_entry_safe(wl, wlb, &cfg_cfgfiles, list) {
free(wl->s);
- LIST_DEL(&wl->list);
+ LIST_DELETE(&wl->list);
free(wl);
}
list_for_each_entry_safe(bol, bolb, &build_opts_list, list) {
if (bol->must_free)
free((void *)bol->str);
- LIST_DEL(&bol->list);
+ LIST_DELETE(&bol->list);
free(bol);
}
list_for_each_entry_safe(pxdf, pxdfb, &proxy_deinit_list, list) {
- LIST_DEL(&pxdf->list);
+ LIST_DELETE(&pxdf->list);
free(pxdf);
}
list_for_each_entry_safe(pdf, pdfb, &post_deinit_list, list) {
- LIST_DEL(&pdf->list);
+ LIST_DELETE(&pdf->list);
free(pdf);
}
list_for_each_entry_safe(srvdf, srvdfb, &server_deinit_list, list) {
- LIST_DEL(&srvdf->list);
+ LIST_DELETE(&srvdf->list);
free(srvdf);
}
list_for_each_entry_safe(pcf, pcfb, &post_check_list, list) {
- LIST_DEL(&pcf->list);
+ LIST_DELETE(&pcf->list);
free(pcf);
}
list_for_each_entry_safe(pscf, pscfb, &post_server_check_list, list) {
- LIST_DEL(&pscf->list);
+ LIST_DELETE(&pscf->list);
free(pscf);
}
list_for_each_entry_safe(ppcf, ppcfb, &post_proxy_check_list, list) {
- LIST_DEL(&ppcf->list);
+ LIST_DELETE(&ppcf->list);
free(ppcf);
}
list_for_each_entry_safe(tif, tifb, &per_thread_init_list, list) {
- LIST_DEL(&tif->list);
+ LIST_DELETE(&tif->list);
free(tif);
}
list_for_each_entry_safe(tdf, tdfb, &per_thread_deinit_list, list) {
- LIST_DEL(&tdf->list);
+ LIST_DELETE(&tdf->list);
free(tdf);
}
list_for_each_entry_safe(taf, tafb, &per_thread_alloc_list, list) {
- LIST_DEL(&taf->list);
+ LIST_DELETE(&taf->list);
free(taf);
}
list_for_each_entry_safe(tff, tffb, &per_thread_free_list, list) {
- LIST_DEL(&tff->list);
+ LIST_DELETE(&tff->list);
free(tff);
}
proc_self = child;
continue;
}
- LIST_DEL(&child->list);
+ LIST_DELETE(&child->list);
mworker_free_child(child);
child = NULL;
}
fcn = calloc(1, sizeof(*fcn));
if (!fcn)
return NULL;
- LIST_ADDQ(&referenced_functions, &fcn->l);
+ LIST_APPEND(&referenced_functions, &fcn->l);
for (i = 0; i < MAX_THREADS + 1; i++)
fcn->function_ref[i] = -1;
return fcn;
return;
if (fcn->name)
ha_free(&fcn->name);
- LIST_DEL(&fcn->l);
+ LIST_DELETE(&fcn->l);
ha_free(&fcn);
}
WILL_LJMP(luaL_error(L, "Lua out of memory error."));
init->function_ref = ref;
- LIST_ADDQ(&hlua_init_functions[hlua_state_id], &init->l);
+ LIST_APPEND(&hlua_init_functions[hlua_state_id], &init->l);
return 0;
}
memprintf(err, "memory allocation failed");
goto err2;
}
- LIST_ADDQ(&prepend_path_list, &p->l);
+ LIST_APPEND(&prepend_path_list, &p->l);
hlua_prepend_path(hlua_states[0], type, path);
hlua_prepend_path(hlua_states[1], type, path);
if (rule->arg.http.re)
regex_free(rule->arg.http.re);
list_for_each_entry_safe(lf, lfb, &rule->arg.http.fmt, list) {
- LIST_DEL(&lf->list);
+ LIST_DELETE(&lf->list);
release_sample_expr(lf->expr);
free(lf->arg);
free(lf);
struct redirect_rule *redir;
redir = rule->arg.redir;
- LIST_DEL(&redir->list);
+ LIST_DELETE(&redir->list);
if (redir->cond) {
prune_acl_cond(redir->cond);
free(redir->cond);
free(redir->rdr_str);
free(redir->cookie_str);
list_for_each_entry_safe(lf, lfb, &redir->rdr_fmt, list) {
- LIST_DEL(&lf->list);
+ LIST_DELETE(&lf->list);
free(lf);
}
free(redir);
free(rule->arg.map.ref);
list_for_each_entry_safe(lf, lfb, &rule->arg.map.key, list) {
- LIST_DEL(&lf->list);
+ LIST_DELETE(&lf->list);
release_sample_expr(lf->expr);
free(lf->arg);
free(lf);
}
if (rule->action == 1) {
list_for_each_entry_safe(lf, lfb, &rule->arg.map.value, list) {
- LIST_DEL(&lf->list);
+ LIST_DELETE(&lf->list);
release_sample_expr(lf->expr);
free(lf->arg);
free(lf);
ha_free(&http_reply->ctype);
list_for_each_entry_safe(hdr, hdrb, &http_reply->hdrs, list) {
- LIST_DEL(&hdr->list);
+ LIST_DELETE(&hdr->list);
list_for_each_entry_safe(lf, lfb, &hdr->value, list) {
- LIST_DEL(&lf->list);
+ LIST_DELETE(&lf->list);
release_sample_expr(lf->expr);
free(lf->arg);
free(lf);
chunk_destroy(&http_reply->body.obj);
else if (http_reply->type == HTTP_REPLY_LOGFMT) {
list_for_each_entry_safe(lf, lfb, &http_reply->body.fmt, list) {
- LIST_DEL(&lf->list);
+ LIST_DELETE(&lf->list);
release_sample_expr(lf->expr);
free(lf->arg);
free(lf);
free(http_errs->id);
for (rc = 0; rc < HTTP_ERR_SIZE; rc++)
release_http_reply(http_errs->replies[rc]);
- LIST_DEL(&http_errs->list);
+ LIST_DELETE(&http_errs->list);
free(http_errs);
}
list_for_each_entry_safe(http_rep, http_repb, &http_replies_list, list) {
- LIST_DEL(&http_rep->list);
+ LIST_DELETE(&http_rep->list);
release_http_reply(http_rep);
}
}
memprintf(errmsg, "'%s' : out of memory", args[cur_arg-1]);
goto error;
}
- LIST_ADDQ(&reply->hdrs, &hdr->list);
+ LIST_APPEND(&reply->hdrs, &hdr->list);
LIST_INIT(&hdr->value);
hdr->name = ist(strdup(args[cur_arg]));
if (!isttest(hdr->name)) {
"with an erorrfile.\n",
px->conf.args.file, px->conf.args.line);
list_for_each_entry_safe(hdr, hdrb, &reply->hdrs, list) {
- LIST_DEL(&hdr->list);
+ LIST_DELETE(&hdr->list);
list_for_each_entry_safe(lf, lfb, &hdr->value, list) {
- LIST_DEL(&lf->list);
+ LIST_DELETE(&lf->list);
release_sample_expr(lf->expr);
free(lf->arg);
free(lf);
reply->ctype = NULL;
LIST_INIT(&reply->hdrs);
reply->body.errmsg = msg;
- LIST_ADDQ(&http_replies_list, &reply->list);
+ LIST_APPEND(&http_replies_list, &reply->list);
conf_err = calloc(1, sizeof(*conf_err));
if (!conf_err) {
conf_err->file = strdup(file);
conf_err->line = line;
- LIST_ADDQ(&curpx->conf.errors, &conf_err->list);
+ LIST_APPEND(&curpx->conf.errors, &conf_err->list);
/* handle warning message */
if (*errmsg)
reply->ctype = NULL;
LIST_INIT(&reply->hdrs);
reply->body.errmsg = msg;
- LIST_ADDQ(&http_replies_list, &reply->list);
+ LIST_APPEND(&http_replies_list, &reply->list);
conf_err = calloc(1, sizeof(*conf_err));
if (!conf_err) {
conf_err->info.errorfile.reply = reply;
conf_err->file = strdup(file);
conf_err->line = line;
- LIST_ADDQ(&curpx->conf.errors, &conf_err->list);
+ LIST_APPEND(&curpx->conf.errors, &conf_err->list);
/* handle warning message */
if (*errmsg)
}
conf_err->file = strdup(file);
conf_err->line = line;
- LIST_ADDQ(&curpx->conf.errors, &conf_err->list);
+ LIST_APPEND(&curpx->conf.errors, &conf_err->list);
out:
return ret;
conf_err->type = 1;
conf_err->info.errorfile.status = reply->status;
conf_err->info.errorfile.reply = reply;
- LIST_ADDQ(&http_replies_list, &reply->list);
+ LIST_APPEND(&http_replies_list, &reply->list);
}
conf_err->file = strdup(file);
conf_err->line = line;
- LIST_ADDQ(&curpx->conf.errors, &conf_err->list);
+ LIST_APPEND(&curpx->conf.errors, &conf_err->list);
/* handle warning message */
if (*errmsg)
}
}
next:
- LIST_DEL(&conf_err->list);
+ LIST_DELETE(&conf_err->list);
free(conf_err->file);
free(conf_err);
}
}
new_conf_err->file = strdup(conf_err->file);
new_conf_err->line = conf_err->line;
- LIST_ADDQ(&curpx->conf.errors, &new_conf_err->list);
+ LIST_APPEND(&curpx->conf.errors, &new_conf_err->list);
new_conf_err = NULL;
}
ret = 1;
list_for_each_entry_safe(conf_err, conf_err_back, &px->conf.errors, list) {
if (conf_err->type == 0)
free(conf_err->info.errorfiles.name);
- LIST_DEL(&conf_err->list);
+ LIST_DELETE(&conf_err->list);
free(conf_err->file);
free(conf_err);
}
goto out;
}
- LIST_ADDQ(&http_errors_list, &curr_errs->list);
+ LIST_APPEND(&http_errors_list, &curr_errs->list);
curr_errs->id = strdup(args[1]);
curr_errs->conf.file = strdup(file);
curr_errs->conf.line = linenum;
exit(1);
}
b->fct = fct;
- LIST_ADDQ(&post_check_list, &b->list);
+ LIST_APPEND(&post_check_list, &b->list);
}
/* used to register some initialization functions to call for each proxy after
exit(1);
}
b->fct = fct;
- LIST_ADDQ(&post_proxy_check_list, &b->list);
+ LIST_APPEND(&post_proxy_check_list, &b->list);
}
/* used to register some initialization functions to call for each server after
exit(1);
}
b->fct = fct;
- LIST_ADDQ(&post_server_check_list, &b->list);
+ LIST_APPEND(&post_server_check_list, &b->list);
}
/* used to register some de-initialization functions to call after everything
exit(1);
}
b->fct = fct;
- LIST_ADDQ(&post_deinit_list, &b->list);
+ LIST_APPEND(&post_deinit_list, &b->list);
}
/* used to register some per proxy de-initialization functions to call after
exit(1);
}
b->fct = fct;
- LIST_ADDQ(&proxy_deinit_list, &b->list);
+ LIST_APPEND(&proxy_deinit_list, &b->list);
}
/* used to register some per server de-initialization functions to call after
exit(1);
}
b->fct = fct;
- LIST_ADDQ(&server_deinit_list, &b->list);
+ LIST_APPEND(&server_deinit_list, &b->list);
}
/* used to register some allocation functions to call for each thread. */
exit(1);
}
b->fct = fct;
- LIST_ADDQ(&per_thread_alloc_list, &b->list);
+ LIST_APPEND(&per_thread_alloc_list, &b->list);
}
/* used to register some initialization functions to call for each thread. */
exit(1);
}
b->fct = fct;
- LIST_ADDQ(&per_thread_init_list, &b->list);
+ LIST_APPEND(&per_thread_init_list, &b->list);
}
/* used to register some de-initialization functions to call for each thread. */
exit(1);
}
b->fct = fct;
- LIST_ADDQ(&per_thread_deinit_list, &b->list);
+ LIST_APPEND(&per_thread_deinit_list, &b->list);
}
/* used to register some free functions to call for each thread. */
exit(1);
}
b->fct = fct;
- LIST_ADDQ(&per_thread_free_list, &b->list);
+ LIST_APPEND(&per_thread_free_list, &b->list);
}
return;
listener_set_state(listener, LI_ASSIGNED);
listener->rx.proto = proto;
- LIST_ADDQ(&proto->receivers, &listener->rx.proto_list);
+ LIST_APPEND(&proto->receivers, &listener->rx.proto_list);
proto->nb_receivers++;
}
if (l->rx.proto->suspend)
ret = l->rx.proto->suspend(l);
- MT_LIST_DEL(&l->wait_queue);
+ MT_LIST_DELETE(&l->wait_queue);
listener_set_state(l, LI_PAUSED);
/* check that another thread didn't to the job in parallel (e.g. at the
* end of listen_accept() while we'd come from dequeue_all_listeners().
*/
- if (MT_LIST_ADDED(&l->wait_queue))
+ if (MT_LIST_INLIST(&l->wait_queue))
goto end;
if ((global.mode & (MODE_DAEMON | MODE_MWORKER)) &&
{
HA_SPIN_LOCK(LISTENER_LOCK, &l->lock);
if (l->state >= LI_READY) {
- MT_LIST_DEL(&l->wait_queue);
+ MT_LIST_DELETE(&l->wait_queue);
if (l->state != LI_FULL) {
l->rx.proto->disable(l);
listener_set_state(l, LI_FULL);
{
HA_SPIN_LOCK(LISTENER_LOCK, &l->lock);
if (l->state == LI_READY) {
- MT_LIST_TRY_ADDQ(list, &l->wait_queue);
+ MT_LIST_TRY_APPEND(list, &l->wait_queue);
l->rx.proto->disable(l);
listener_set_state(l, LI_LIMITED);
}
*/
void do_unbind_listener(struct listener *listener)
{
- MT_LIST_DEL(&listener->wait_queue);
+ MT_LIST_DELETE(&listener->wait_queue);
if (listener->rx.proto->unbind)
listener->rx.proto->unbind(listener);
return 0;
}
l->obj_type = OBJ_TYPE_LISTENER;
- LIST_ADDQ(&bc->frontend->conf.listeners, &l->by_fe);
- LIST_ADDQ(&bc->listeners, &l->by_bind);
+ LIST_APPEND(&bc->frontend->conf.listeners, &l->by_fe);
+ LIST_APPEND(&bc->listeners, &l->by_bind);
l->bind_conf = bc;
l->rx.settings = &bc->settings;
l->rx.owner = l;
{
if (listener->state == LI_ASSIGNED) {
listener_set_state(listener, LI_INIT);
- LIST_DEL(&listener->rx.proto_list);
+ LIST_DELETE(&listener->rx.proto_list);
listener->rx.proto->nb_receivers--;
_HA_ATOMIC_DEC(&jobs);
_HA_ATOMIC_DEC(&listeners);
*/
void bind_register_keywords(struct bind_kw_list *kwl)
{
- LIST_ADDQ(&bind_keywords.list, &kwl->list);
+ LIST_APPEND(&bind_keywords.list, &kwl->list);
}
/* Return a pointer to the bind keyword <kw>, or NULL if not found. If the
goto error_free;
}
curproxy->to_log |= logformat_keywords[j].lw;
- LIST_ADDQ(list_format, &node->list);
+ LIST_APPEND(list_format, &node->list);
}
if (logformat_keywords[j].replace_by)
ha_warning("parsing [%s:%d] : deprecated variable '%s' in '%s', please replace it with '%s'.\n",
str[end - start] = '\0';
node->arg = str;
node->type = LOG_FMT_TEXT; // type string
- LIST_ADDQ(list_format, &node->list);
+ LIST_APPEND(list_format, &node->list);
} else if (type == LF_SEPARATOR) {
struct logformat_node *node = calloc(1, sizeof(*node));
if (!node) {
return 0;
}
node->type = LOG_FMT_SEPARATOR;
- LIST_ADDQ(list_format, &node->list);
+ LIST_APPEND(list_format, &node->list);
}
return 1;
}
curpx->to_log |= LW_XPRT;
if (curpx->http_needed)
curpx->to_log |= LW_REQ;
- LIST_ADDQ(list_format, &node->list);
+ LIST_APPEND(list_format, &node->list);
return 1;
error_free:
/* flush the list first. */
list_for_each_entry_safe(tmplf, back, list_format, list) {
- LIST_DEL(&tmplf->list);
+ LIST_DELETE(&tmplf->list);
release_sample_expr(tmplf->expr);
free(tmplf->arg);
free(tmplf);
}
list_for_each_entry_safe(logsrv, back, logsrvs, list) {
- LIST_DEL(&logsrv->list);
+ LIST_DELETE(&logsrv->list);
free(logsrv);
}
return 1;
memcpy(node, logsrv, sizeof(struct logsrv));
node->ref = logsrv;
LIST_INIT(&node->list);
- LIST_ADDQ(logsrvs, &node->list);
+ LIST_APPEND(logsrvs, &node->list);
node->conf.file = strdup(file);
node->conf.line = linenum;
}
done:
- LIST_ADDQ(logsrvs, &logsrv->list);
+ LIST_APPEND(logsrvs, &logsrv->list);
return 1;
error:
#include <import/lru.h>
/* Minimal list manipulation macros for lru64_list */
-#define LIST_ADD(lh, el) ({ (el)->n = (lh)->n; (el)->n->p = (lh)->n = (el); (el)->p = (lh); })
-#define LIST_DEL(el) ({ (el)->n->p = (el)->p; (el)->p->n = (el)->n; })
+#define LIST_INSERT(lh, el) ({ (el)->n = (lh)->n; (el)->n->p = (lh)->n = (el); (el)->p = (lh); })
+#define LIST_DELETE(el) ({ (el)->n->p = (el)->p; (el)->p->n = (el)->n; })
/* Lookup key <key> in LRU cache <lru> for use with domain <domain> whose data's
* head of the LRU list.
*/
if (elem->domain == domain && elem->revision == revision) {
- LIST_DEL(&elem->lru);
- LIST_ADD(&lru->list, &elem->lru);
+ LIST_DELETE(&elem->lru);
+ LIST_INSERT(&lru->list, &elem->lru);
return elem;
}
}
* head of the LRU list.
*/
if (elem->domain == domain && elem->revision == revision) {
- LIST_DEL(&elem->lru);
- LIST_ADD(&lru->list, &elem->lru);
+ LIST_DELETE(&elem->lru);
+ LIST_INSERT(&lru->list, &elem->lru);
return elem;
}
return NULL; // currently locked
/* recycle this entry */
- LIST_DEL(&elem->lru);
+ LIST_DELETE(&elem->lru);
}
else {
/* New entry inserted, initialize and move to the head of the
}
elem->domain = NULL;
- LIST_ADD(&lru->list, &elem->lru);
+ LIST_INSERT(&lru->list, &elem->lru);
if (lru->cache_usage > lru->cache_size) {
/* try to kill oldest entry */
old = container_of(lru->list.p, typeof(*old), lru);
if (old->domain) {
/* not locked */
- LIST_DEL(&old->lru);
+ LIST_DELETE(&old->lru);
__eb64_delete(&old->node);
if (old->data && old->free)
old->free(old->data);
next = container_of(elem->lru.p, typeof(*next), lru);
if (elem->domain) {
/* not locked */
- LIST_DEL(&elem->lru);
+ LIST_DELETE(&elem->lru);
eb64_delete(&elem->node);
if (elem->data && elem->free)
elem->free(elem->data);
if (!elem->domain)
continue; /* locked entry */
- LIST_DEL(&elem->lru);
+ LIST_DELETE(&elem->lru);
eb64_delete(&elem->node);
if (elem->data && elem->free)
elem->free(elem->data);
if (alert->rules.list) {
list_for_each_entry_safe(rule, back, alert->rules.list, list) {
- LIST_DEL(&rule->list);
+ LIST_DELETE(&rule->list);
free_tcpcheck(rule, 1);
}
free_tcpcheck_vars(&alert->rules.preset_vars);
}
alert = LIST_NEXT(&q->email_alerts, typeof(alert), list);
- LIST_DEL(&alert->list);
+ LIST_DELETE(&alert->list);
t->expire = now_ms;
check->tcpcheck_rules = &alert->rules;
check->status = HCHK_STATUS_INI;
tcpcheck->action = TCPCHK_ACT_CONNECT;
tcpcheck->comment = NULL;
- LIST_ADDQ(alert->rules.list, &tcpcheck->list);
+ LIST_APPEND(alert->rules.list, &tcpcheck->list);
if (!add_tcpcheck_expect_str(&alert->rules, "220 "))
goto error;
HA_SPIN_LOCK(EMAIL_ALERTS_LOCK, &q->lock);
task_wakeup(check->task, TASK_WOKEN_MSG);
- LIST_ADDQ(&q->email_alerts, &alert->list);
+ LIST_APPEND(&q->email_alerts, &alert->list);
HA_SPIN_UNLOCK(EMAIL_ALERTS_LOCK, &q->lock);
return 1;
*/
if (appctx->st2 == STAT_ST_LIST) {
if (!LIST_ISEMPTY(&appctx->ctx.map.bref.users)) {
- LIST_DEL(&appctx->ctx.map.bref.users);
+ LIST_DELETE(&appctx->ctx.map.bref.users);
LIST_INIT(&appctx->ctx.map.bref.users);
}
}
HA_SPIN_LOCK(PATREF_LOCK, &appctx->ctx.map.ref->lock);
if (!LIST_ISEMPTY(&appctx->ctx.map.bref.users)) {
- LIST_DEL(&appctx->ctx.map.bref.users);
+ LIST_DELETE(&appctx->ctx.map.bref.users);
LIST_INIT(&appctx->ctx.map.bref.users);
}
/* let's try again later from this stream. We add ourselves into
* this stream's users so that it can remove us upon termination.
*/
- LIST_ADDQ(&elt->back_refs, &appctx->ctx.map.bref.users);
+ LIST_APPEND(&elt->back_refs, &appctx->ctx.map.bref.users);
HA_SPIN_UNLOCK(PATREF_LOCK, &appctx->ctx.map.ref->lock);
si_rx_room_blk(si);
return 0;
if (appctx->st2 == STAT_ST_LIST) {
HA_SPIN_LOCK(PATREF_LOCK, &appctx->ctx.map.ref->lock);
if (!LIST_ISEMPTY(&appctx->ctx.map.bref.users))
- LIST_DEL(&appctx->ctx.map.bref.users);
+ LIST_DELETE(&appctx->ctx.map.bref.users);
HA_SPIN_UNLOCK(PATREF_LOCK, &appctx->ctx.map.ref->lock);
}
}
{
struct buffer *buf = NULL;
- if (likely(!LIST_ADDED(&fconn->buf_wait.list)) &&
+ if (likely(!LIST_INLIST(&fconn->buf_wait.list)) &&
unlikely((buf = b_alloc(bptr)) == NULL)) {
fconn->buf_wait.target = fconn;
fconn->buf_wait.wakeup_cb = fcgi_buf_available;
- LIST_ADDQ(&ti->buffer_wq, &fconn->buf_wait.list);
+ LIST_APPEND(&ti->buffer_wq, &fconn->buf_wait.list);
}
return buf;
}
TRACE_DEVEL("freeing fconn", FCGI_EV_FCONN_END, conn);
- if (LIST_ADDED(&fconn->buf_wait.list))
+ if (LIST_INLIST(&fconn->buf_wait.list))
LIST_DEL_INIT(&fconn->buf_wait.list);
fcgi_release_buf(fconn, &fconn->dbuf);
}
else if (!fconn->conn->hash_node->node.node.leaf_p &&
fcgi_avail_streams(fconn->conn) > 0 && objt_server(fconn->conn->target) &&
- !LIST_ADDED(&fconn->conn->session_list)) {
+ !LIST_INLIST(&fconn->conn->session_list)) {
ebmb_insert(&__objt_server(fconn->conn->target)->per_thr[tid].avail_conns,
&fconn->conn->hash_node->node,
sizeof(fconn->conn->hash_node->hash));
* automatically called via the shut_tl tasklet when there's room
* again.
*/
- if (!LIST_ADDED(&fstrm->send_list)) {
+ if (!LIST_INLIST(&fstrm->send_list)) {
if (fstrm->flags & (FCGI_SF_BLK_MBUSY|FCGI_SF_BLK_MROOM)) {
- LIST_ADDQ(&fconn->send_list, &fstrm->send_list);
+ LIST_APPEND(&fconn->send_list, &fstrm->send_list);
}
}
fstrm->flags |= FCGI_SF_WANT_SHUTR;
* automatically called via the shut_tl tasklet when there's room
* again.
*/
- if (!LIST_ADDED(&fstrm->send_list)) {
+ if (!LIST_INLIST(&fstrm->send_list)) {
if (fstrm->flags & (FCGI_SF_BLK_MBUSY|FCGI_SF_BLK_MROOM)) {
- LIST_ADDQ(&fconn->send_list, &fstrm->send_list);
+ LIST_APPEND(&fconn->send_list, &fstrm->send_list);
}
}
fstrm->flags |= FCGI_SF_WANT_SHUTW;
if (event_type & SUB_RETRY_SEND) {
TRACE_DEVEL("unsubscribe(send)", FCGI_EV_STRM_SEND, fconn->conn, fstrm);
- if (!LIST_ADDED(&fstrm->send_list))
- LIST_ADDQ(&fconn->send_list, &fstrm->send_list);
+ if (!LIST_INLIST(&fstrm->send_list))
+ LIST_APPEND(&fconn->send_list, &fstrm->send_list);
}
return 0;
}
{
struct buffer *buf = NULL;
- if (likely(!LIST_ADDED(&h1c->buf_wait.list)) &&
+ if (likely(!LIST_INLIST(&h1c->buf_wait.list)) &&
unlikely((buf = b_alloc(bptr)) == NULL)) {
h1c->buf_wait.target = h1c;
h1c->buf_wait.wakeup_cb = h1_buf_available;
- LIST_ADDQ(&ti->buffer_wq, &h1c->buf_wait.list);
+ LIST_APPEND(&ti->buffer_wq, &h1c->buf_wait.list);
}
return buf;
}
}
- if (LIST_ADDED(&h1c->buf_wait.list))
+ if (LIST_INLIST(&h1c->buf_wait.list))
LIST_DEL_INIT(&h1c->buf_wait.list);
h1_release_buf(h1c, &h1c->ibuf);
{
struct buffer *buf = NULL;
- if (likely(!LIST_ADDED(&h2c->buf_wait.list)) &&
+ if (likely(!LIST_INLIST(&h2c->buf_wait.list)) &&
unlikely((buf = b_alloc(bptr)) == NULL)) {
h2c->buf_wait.target = h2c;
h2c->buf_wait.wakeup_cb = h2_buf_available;
- LIST_ADDQ(&ti->buffer_wq, &h2c->buf_wait.list);
+ LIST_APPEND(&ti->buffer_wq, &h2c->buf_wait.list);
}
return buf;
}
TRACE_DEVEL("freeing h2c", H2_EV_H2C_END, conn);
hpack_dht_free(h2c->ddht);
- if (LIST_ADDED(&h2c->buf_wait.list))
+ if (LIST_INLIST(&h2c->buf_wait.list))
LIST_DEL_INIT(&h2c->buf_wait.list);
h2_release_buf(h2c, &h2c->dbuf);
LIST_DEL_INIT(&h2s->list);
if ((h2s->subs && h2s->subs->events & SUB_RETRY_SEND) ||
h2s->flags & (H2_SF_WANT_SHUTR|H2_SF_WANT_SHUTW))
- LIST_ADDQ(&h2c->send_list, &h2s->list);
+ LIST_APPEND(&h2c->send_list, &h2s->list);
}
node = eb32_next(node);
}
LIST_DEL_INIT(&h2s->list);
if ((h2s->subs && h2s->subs->events & SUB_RETRY_SEND) ||
h2s->flags & (H2_SF_WANT_SHUTR|H2_SF_WANT_SHUTW))
- LIST_ADDQ(&h2c->send_list, &h2s->list);
+ LIST_APPEND(&h2c->send_list, &h2s->list);
}
}
else {
}
else if (!h2c->conn->hash_node->node.node.leaf_p &&
h2_avail_streams(h2c->conn) > 0 && objt_server(h2c->conn->target) &&
- !LIST_ADDED(&h2c->conn->session_list)) {
+ !LIST_INLIST(&h2c->conn->session_list)) {
ebmb_insert(&__objt_server(h2c->conn->target)->per_thr[tid].avail_conns,
&h2c->conn->hash_node->node,
sizeof(h2c->conn->hash_node->hash));
* again.
*/
h2s->flags |= H2_SF_WANT_SHUTR;
- if (!LIST_ADDED(&h2s->list)) {
+ if (!LIST_INLIST(&h2s->list)) {
if (h2s->flags & H2_SF_BLK_MFCTL)
- LIST_ADDQ(&h2c->fctl_list, &h2s->list);
+ LIST_APPEND(&h2c->fctl_list, &h2s->list);
else if (h2s->flags & (H2_SF_BLK_MBUSY|H2_SF_BLK_MROOM))
- LIST_ADDQ(&h2c->send_list, &h2s->list);
+ LIST_APPEND(&h2c->send_list, &h2s->list);
}
TRACE_LEAVE(H2_EV_STRM_SHUT, h2c->conn, h2s);
return;
* again.
*/
h2s->flags |= H2_SF_WANT_SHUTW;
- if (!LIST_ADDED(&h2s->list)) {
+ if (!LIST_INLIST(&h2s->list)) {
if (h2s->flags & H2_SF_BLK_MFCTL)
- LIST_ADDQ(&h2c->fctl_list, &h2s->list);
+ LIST_APPEND(&h2c->fctl_list, &h2s->list);
else if (h2s->flags & (H2_SF_BLK_MBUSY|H2_SF_BLK_MROOM))
- LIST_ADDQ(&h2c->send_list, &h2s->list);
+ LIST_APPEND(&h2c->send_list, &h2s->list);
}
TRACE_LEAVE(H2_EV_STRM_SHUT, h2c->conn, h2s);
return;
if (h2s_mws(h2s) <= 0) {
h2s->flags |= H2_SF_BLK_SFCTL;
- if (LIST_ADDED(&h2s->list))
+ if (LIST_INLIST(&h2s->list))
LIST_DEL_INIT(&h2s->list);
- LIST_ADDQ(&h2c->blocked_list, &h2s->list);
+ LIST_APPEND(&h2c->blocked_list, &h2s->list);
TRACE_STATE("stream window <=0, flow-controlled", H2_EV_TX_FRAME|H2_EV_TX_DATA|H2_EV_H2S_FCTL, h2c->conn, h2s);
goto end;
}
if (event_type & SUB_RETRY_SEND) {
TRACE_DEVEL("subscribe(send)", H2_EV_STRM_SEND, h2c->conn, h2s);
if (!(h2s->flags & H2_SF_BLK_SFCTL) &&
- !LIST_ADDED(&h2s->list)) {
+ !LIST_INLIST(&h2s->list)) {
if (h2s->flags & H2_SF_BLK_MFCTL)
- LIST_ADDQ(&h2c->fctl_list, &h2s->list);
+ LIST_APPEND(&h2c->fctl_list, &h2s->list);
else
- LIST_ADDQ(&h2c->send_list, &h2s->list);
+ LIST_APPEND(&h2c->send_list, &h2s->list);
}
}
TRACE_LEAVE(H2_EV_STRM_SEND|H2_EV_STRM_RECV, h2c->conn, h2s);
}
- LIST_DEL(&child->list);
+ LIST_DELETE(&child->list);
mworker_free_child(child);
child = NULL;
goto error;
}
- LIST_ADDQ(&proc_list, &ext_child->list);
+ LIST_APPEND(&proc_list, &ext_child->list);
} else if (strcmp(args[0], "command") == 0) {
int arg_nb = 0;
error:
if (ext_child) {
- LIST_DEL(&ext_child->list);
+ LIST_DELETE(&ext_child->list);
if (ext_child->command) {
int i;
/* this is a process inherited from a reload that should be leaving */
child->options |= PROC_O_LEAVING;
- LIST_ADDQ(&proc_list, &child->list);
+ LIST_APPEND(&proc_list, &child->list);
} else {
mworker_free_child(child);
}
if (child->pid != exitpid)
continue;
- LIST_DEL(&child->list);
+ LIST_DELETE(&child->list);
close(child->ipc_fd[0]);
childfound = 1;
break;
struct pattern_list *pat, *tmp;
list_for_each_entry_safe(pat, tmp, &expr->patterns, list) {
- LIST_DEL(&pat->list);
+ LIST_DELETE(&pat->list);
pat_unlink_from_head(&pat->pat.ref->list_head, &pat->from_ref);
if (pat->pat.sflags & PAT_SF_REGFREE)
regex_free(pat->pat.ptr.ptr);
memcpy(&patl->pat, pat, sizeof(*pat));
/* chain pattern in the expression */
- LIST_ADDQ(&expr->patterns, &patl->list);
+ LIST_APPEND(&expr->patterns, &patl->list);
/* and from the reference */
patl->from_ref = pat->ref->list_head;
pat->ref->list_head = &patl->from_ref;
memcpy(patl->pat.ptr.ptr, pat->ptr.ptr, pat->len);
/* chain pattern in the expression */
- LIST_ADDQ(&expr->patterns, &patl->list);
+ LIST_APPEND(&expr->patterns, &patl->list);
/* and from the reference */
patl->from_ref = pat->ref->list_head;
pat->ref->list_head = &patl->from_ref;
patl->pat.ptr.str[patl->pat.len] = '\0';
/* chain pattern in the expression */
- LIST_ADDQ(&expr->patterns, &patl->list);
+ LIST_APPEND(&expr->patterns, &patl->list);
/* and from the reference */
patl->from_ref = pat->ref->list_head;
pat->ref->list_head = &patl->from_ref;
}
/* chain pattern in the expression */
- LIST_ADDQ(&expr->patterns, &patl->list);
+ LIST_APPEND(&expr->patterns, &patl->list);
/* and from the reference */
patl->from_ref = pat->ref->list_head;
pat->ref->list_head = &patl->from_ref;
BUG_ON(pat->pat.ref != elt);
/* Delete and free entry. */
- LIST_DEL(&pat->list);
+ LIST_DELETE(&pat->list);
if (pat->pat.sflags & PAT_SF_REGFREE)
regex_free(pat->pat.ptr.reg);
else
* not relink them if this elt was the last one in the list.
*/
list_for_each_entry_safe(bref, back, &elt->back_refs, users) {
- LIST_DEL(&bref->users);
+ LIST_DELETE(&bref->users);
LIST_INIT(&bref->users);
if (elt->list.n != &ref->head)
- LIST_ADDQ(&LIST_ELEM(elt->list.n, typeof(elt), list)->back_refs, &bref->users);
+ LIST_APPEND(&LIST_ELEM(elt->list.n, typeof(elt), list)->back_refs, &bref->users);
bref->ref = elt->list.n;
}
list_for_each_entry(expr, &ref->pat, list)
HA_RWLOCK_WRUNLOCK(PATEXP_LOCK, &expr->lock);
- LIST_DEL(&elt->list);
+ LIST_DELETE(&elt->list);
free(elt->sample);
free(elt->pattern);
free(elt);
LIST_INIT(&ref->head);
LIST_INIT(&ref->pat);
HA_SPIN_INIT(&ref->lock);
- LIST_ADDQ(&pattern_reference, &ref->list);
+ LIST_APPEND(&pattern_reference, &ref->list);
return ref;
}
LIST_INIT(&ref->head);
LIST_INIT(&ref->pat);
HA_SPIN_INIT(&ref->lock);
- LIST_ADDQ(&pattern_reference, &ref->list);
+ LIST_APPEND(&pattern_reference, &ref->list);
return ref;
}
LIST_INIT(&elt->back_refs);
elt->list_head = NULL;
elt->tree_head = NULL;
- LIST_ADDQ(&ref->head, &elt->list);
+ LIST_APPEND(&ref->head, &elt->list);
return elt;
fail:
if (elt)
* not relink them if this elt was the last one in the list.
*/
list_for_each_entry_safe(bref, bref_bck, &elt->back_refs, users) {
- LIST_DEL(&bref->users);
+ LIST_DELETE(&bref->users);
LIST_INIT(&bref->users);
if (elt->list.n != &ref->head)
- LIST_ADDQ(&LIST_ELEM(elt->list.n, typeof(elt), list)->back_refs, &bref->users);
+ LIST_APPEND(&LIST_ELEM(elt->list.n, typeof(elt), list)->back_refs, &bref->users);
bref->ref = elt->list.n;
}
/* delete the storage for all representations of this pattern. */
pat_delete_gen(ref, elt);
- LIST_DEL(&elt->list);
+ LIST_DELETE(&elt->list);
free(elt->pattern);
free(elt->sample);
free(elt);
bref->ref = NULL;
}
pat_delete_gen(ref, elt);
- LIST_DEL(&elt->list);
+ LIST_DELETE(&elt->list);
free(elt->pattern);
free(elt->sample);
free(elt);
}
/* switch pat_ret_elt lists */
- LIST_ADD(&replace->head, &ref->head);
- LIST_DEL(&replace->head);
+ LIST_INSERT(&replace->head, &ref->head);
+ LIST_DELETE(&replace->head);
list_for_each_entry(expr, &ref->pat, list) {
list_for_each_entry(elt, &ref->head, list) {
/* This new pattern expression reference one of his heads. */
expr->pat_head = head;
- /* Link with ref, or to self to facilitate LIST_DEL() */
+ /* Link with ref, or to self to facilitate LIST_DELETE() */
if (ref)
- LIST_ADDQ(&ref->pat, &expr->list);
+ LIST_APPEND(&ref->pat, &expr->list);
else
LIST_INIT(&expr->list);
list->expr = expr;
/* Link the list element with the pattern_head. */
- LIST_ADDQ(&head->head, &list->list);
+ LIST_APPEND(&head->head, &list->list);
return expr;
}
struct pattern_expr_list *list, *safe;
list_for_each_entry_safe(list, safe, &head->head, list) {
- LIST_DEL(&list->list);
+ LIST_DELETE(&list->list);
if (list->do_free) {
- LIST_DEL(&list->expr->list);
+ LIST_DELETE(&list->expr->list);
HA_RWLOCK_WRLOCK(PATEXP_LOCK, &list->expr->lock);
head->prune(list->expr);
HA_RWLOCK_WRUNLOCK(PATEXP_LOCK, &list->expr->lock);
/* Convert back to linked list */
for (i = 0; i < len; i++)
- LIST_ADDQ(&pr, &arr[i]->list);
+ LIST_APPEND(&pr, &arr[i]->list);
/* swap root */
- LIST_ADD(&pr, &pattern_reference);
- LIST_DEL(&pr);
+ LIST_INSERT(&pr, &pattern_reference);
+ LIST_DELETE(&pr);
free(arr);
return 0;
/* Error unrolling */
out_free_strm:
- LIST_DEL(&s->list);
+ LIST_DELETE(&s->list);
pool_free(pool_head_stream, s);
out_free_sess:
session_free(sess);
strlcpy2(pool->name, name, sizeof(pool->name));
pool->size = size;
pool->flags = flags;
- LIST_ADDQ(start, &pool->list);
+ LIST_APPEND(start, &pool->list);
#ifdef CONFIG_HAP_POOLS
/* update per-thread pool cache if necessary */
ph->count--;
pool_cache_bytes -= pool->size;
pool_cache_count--;
- LIST_DEL(&item->by_pool);
- LIST_DEL(&item->by_lru);
+ LIST_DELETE(&item->by_pool);
+ LIST_DELETE(&item->by_lru);
pool_put_to_shared_cache(pool, item);
}
}
*/
ph = LIST_NEXT(&item->by_pool, struct pool_cache_head *, list);
pool = container_of(ph - tid, struct pool_head, cache);
- LIST_DEL(&item->by_pool);
- LIST_DEL(&item->by_lru);
+ LIST_DELETE(&item->by_pool);
+ LIST_DELETE(&item->by_lru);
ph->count--;
pool_cache_count--;
pool_cache_bytes -= pool->size;
struct pool_cache_item *item = (struct pool_cache_item *)ptr;
struct pool_cache_head *ph = &pool->cache[tid];
- LIST_ADD(&ph->list, &item->by_pool);
- LIST_ADD(&ti->pool_lru_head, &item->by_lru);
+ LIST_INSERT(&ph->list, &item->by_pool);
+ LIST_INSERT(&ti->pool_lru_head, &item->by_lru);
ph->count++;
pool_cache_count++;
pool_cache_bytes += pool->size;
return pool;
pool->users--;
if (!pool->users) {
- LIST_DEL(&pool->list);
+ LIST_DELETE(&pool->list);
#ifndef CONFIG_HAP_LOCKLESS_POOLS
HA_SPIN_DESTROY(&pool->lock);
#endif
void protocol_register(struct protocol *proto)
{
HA_SPIN_LOCK(PROTO_LOCK, &proto_lock);
- LIST_ADDQ(&protocols, &proto->list);
+ LIST_APPEND(&protocols, &proto->list);
if (proto->fam->sock_domain >= 0 && proto->fam->sock_domain < AF_CUST_MAX)
__protocol_by_family[proto->fam->sock_domain]
[proto->sock_type == SOCK_DGRAM]
void protocol_unregister(struct protocol *proto)
{
HA_SPIN_LOCK(PROTO_LOCK, &proto_lock);
- LIST_DEL(&proto->list);
+ LIST_DELETE(&proto->list);
LIST_INIT(&proto->list);
HA_SPIN_UNLOCK(PROTO_LOCK, &proto_lock);
}
struct sticking_rule *rule, *ruleb;
list_for_each_entry_safe(rule, ruleb, rules, list) {
- LIST_DEL(&rule->list);
+ LIST_DELETE(&rule->list);
free_acl_cond(rule->cond);
release_sample_expr(rule->expr);
free(rule);
free(p->conf.lfsd_file);
list_for_each_entry_safe(cond, condb, &p->mon_fail_cond, list) {
- LIST_DEL(&cond->list);
+ LIST_DELETE(&cond->list);
prune_acl_cond(cond);
free(cond);
}
EXTRA_COUNTERS_FREE(p->extra_counters_be);
list_for_each_entry_safe(acl, aclb, &p->acl, list) {
- LIST_DEL(&acl->list);
+ LIST_DELETE(&acl->list);
prune_acl(acl);
free(acl);
}
list_for_each_entry_safe(srule, sruleb, &p->server_rules, list) {
- LIST_DEL(&srule->list);
+ LIST_DELETE(&srule->list);
prune_acl_cond(srule->cond);
list_for_each_entry_safe(lf, lfb, &srule->expr, list) {
- LIST_DEL(&lf->list);
+ LIST_DELETE(&lf->list);
release_sample_expr(lf->expr);
free(lf->arg);
free(lf);
}
list_for_each_entry_safe(rule, ruleb, &p->switching_rules, list) {
- LIST_DEL(&rule->list);
+ LIST_DELETE(&rule->list);
if (rule->cond) {
prune_acl_cond(rule->cond);
free(rule->cond);
}
list_for_each_entry_safe(rdr, rdrb, &p->redirect_rules, list) {
- LIST_DEL(&rdr->list);
+ LIST_DELETE(&rdr->list);
if (rdr->cond) {
prune_acl_cond(rdr->cond);
free(rdr->cond);
}
free(rdr->rdr_str);
list_for_each_entry_safe(lf, lfb, &rdr->rdr_fmt, list) {
- LIST_DEL(&lf->list);
+ LIST_DELETE(&lf->list);
free(lf);
}
free(rdr);
}
list_for_each_entry_safe(log, logb, &p->logsrvs, list) {
- LIST_DEL(&log->list);
+ LIST_DELETE(&log->list);
free(log);
}
list_for_each_entry_safe(lf, lfb, &p->logformat, list) {
- LIST_DEL(&lf->list);
+ LIST_DELETE(&lf->list);
release_sample_expr(lf->expr);
free(lf->arg);
free(lf);
}
list_for_each_entry_safe(lf, lfb, &p->logformat_sd, list) {
- LIST_DEL(&lf->list);
+ LIST_DELETE(&lf->list);
release_sample_expr(lf->expr);
free(lf->arg);
free(lf);
}
list_for_each_entry_safe(lf, lfb, &p->format_unique_id, list) {
- LIST_DEL(&lf->list);
+ LIST_DELETE(&lf->list);
release_sample_expr(lf->expr);
free(lf->arg);
free(lf);
}/* end while(s) */
list_for_each_entry_safe(l, l_next, &p->conf.listeners, by_fe) {
- LIST_DEL(&l->by_fe);
- LIST_DEL(&l->by_bind);
+ LIST_DELETE(&l->by_fe);
+ LIST_DELETE(&l->by_bind);
free(l->name);
free(l->counters);
bind_conf->xprt->destroy_bind_conf(bind_conf);
free(bind_conf->file);
free(bind_conf->arg);
- LIST_DEL(&bind_conf->by_fe);
+ LIST_DELETE(&bind_conf->by_fe);
free(bind_conf);
}
memcpy(node, tmplogsrv, sizeof(struct logsrv));
node->ref = tmplogsrv->ref;
LIST_INIT(&node->list);
- LIST_ADDQ(&curproxy->logsrvs, &node->list);
+ LIST_APPEND(&curproxy->logsrvs, &node->list);
}
curproxy->conf.uniqueid_format_string = defproxy->conf.uniqueid_format_string;
goto err;
qc = pkt->qc;
- LIST_DEL(&pkt->rx_list);
+ LIST_DELETE(&pkt->rx_list);
if (!new_quic_cli_conn(qc, l, &pkt->saddr))
goto err;
proxy_type_str(px), px->id, srv->id);
goto err;
}
- LIST_ADDQ(&resolv_srvrq_list, &srvrq->list);
+ LIST_APPEND(&resolv_srvrq_list, &srvrq->list);
return srvrq;
err:
}
/* Push the resolution at the end of the active list */
- LIST_DEL(&resolution->list);
- LIST_ADDQ(&resolvers->resolutions.curr, &resolution->list);
+ LIST_DELETE(&resolution->list);
+ LIST_APPEND(&resolvers->resolutions.curr, &resolution->list);
return 0;
}
}
rm_obselete_item:
- LIST_DEL(&item->list);
+ LIST_DELETE(&item->list);
if (item->ar_item) {
pool_free(resolv_answer_item_pool, item->ar_item);
item->ar_item = NULL;
if (query_record_id > DNS_MAX_QUERY_RECORDS)
goto invalid_resp;
query = &resolution->response_query_records[query_record_id];
- LIST_ADDQ(&r_res->query_list, &query->list);
+ LIST_APPEND(&r_res->query_list, &query->list);
/* Name is a NULL terminated string in our case, since we have
* one query per response and the first one can't be compressed
else {
answer_record->last_seen = now_ms;
answer_record->ar_item = NULL;
- LIST_ADDQ(&r_res->answer_list, &answer_record->list);
+ LIST_APPEND(&r_res->answer_list, &answer_record->list);
answer_record = NULL;
}
} /* for i 0 to ancount */
list_for_each_entry(record, &r_res->answer_list, list) {
/* Move the first record to the end of the list, for internal
* round robin */
- LIST_DEL(&record->list);
- LIST_ADDQ(&r_res->answer_list, &record->list);
+ LIST_DELETE(&record->list);
+ LIST_APPEND(&r_res->answer_list, &record->list);
break;
}
return RSLV_UPD_SRVIP_NOT_FOUND;
++resolution_uuid;
/* Move the resolution to the resolvers wait queue */
- LIST_ADDQ(&resolvers->resolutions.wait, &res->list);
+ LIST_APPEND(&resolvers->resolutions.wait, &res->list);
}
return res;
}
struct resolv_answer_item *item, *itemback;
list_for_each_entry_safe(item, itemback, &resolution->response.answer_list, list) {
- LIST_DEL(&item->list);
+ LIST_DELETE(&item->list);
pool_free(resolv_answer_item_pool, item->ar_item);
pool_free(resolv_answer_item_pool, item);
}
resolution->hostname_dn_len = 0;
list_for_each_entry_safe(req, reqback, &resolution->requesters, list) {
- LIST_DEL(&req->list);
+ LIST_DELETE(&req->list);
req->resolution = NULL;
}
resolv_purge_resolution_answer_records(resolution);
- LIST_DEL(&resolution->list);
+ LIST_DELETE(&resolution->list);
pool_free(resolv_resolution_pool, resolution);
}
req->resolution = res;
- LIST_ADDQ(&res->requesters, &req->list);
+ LIST_APPEND(&res->requesters, &req->list);
return 0;
err:
res = requester->resolution;
/* Clean up the requester */
- LIST_DEL(&requester->list);
+ LIST_DELETE(&requester->list);
requester->resolution = NULL;
/* We need to find another requester linked on this resolution */
list_for_each_entry(req, &res->requesters, list)
req->requester_error_cb(req, dns_resp);
resolv_reset_resolution(res);
- LIST_DEL(&res->list);
- LIST_ADDQ(&resolvers->resolutions.wait, &res->list);
+ LIST_DELETE(&res->list);
+ LIST_APPEND(&resolvers->resolutions.wait, &res->list);
continue;
report_res_success:
}
resolv_reset_resolution(res);
- LIST_DEL(&res->list);
- LIST_ADDQ(&resolvers->resolutions.wait, &res->list);
+ LIST_DELETE(&res->list);
+ LIST_APPEND(&resolvers->resolutions.wait, &res->list);
continue;
}
resolv_update_resolvers_timeout(resolvers);
/* Clean up resolution info and remove it from the
* current list */
resolv_reset_resolution(res);
- LIST_DEL(&res->list);
- LIST_ADDQ(&resolvers->resolutions.wait, &res->list);
+ LIST_DELETE(&res->list);
+ LIST_APPEND(&resolvers->resolutions.wait, &res->list);
}
else {
/* Otherwise resend the DNS query and requeue the resolution */
if (resolv_run_resolution(res) != 1) {
res->last_resolution = now_ms;
- LIST_DEL(&res->list);
- LIST_ADDQ(&resolvers->resolutions.wait, &res->list);
+ LIST_DELETE(&res->list);
+ LIST_APPEND(&resolvers->resolutions.wait, &res->list);
}
}
task_destroy(ns->stream->task_rsp);
free(ns->stream);
}
- LIST_DEL(&ns->list);
+ LIST_DELETE(&ns->list);
EXTRA_COUNTERS_FREE(ns->extra_counters);
free(ns);
}
list_for_each_entry_safe(res, resback, &resolvers->resolutions.curr, list) {
list_for_each_entry_safe(req, reqback, &res->requesters, list) {
- LIST_DEL(&req->list);
+ LIST_DELETE(&req->list);
pool_free(resolv_requester_pool, req);
}
resolv_free_resolution(res);
list_for_each_entry_safe(res, resback, &resolvers->resolutions.wait, list) {
list_for_each_entry_safe(req, reqback, &res->requesters, list) {
- LIST_DEL(&req->list);
+ LIST_DELETE(&req->list);
pool_free(resolv_requester_pool, req);
}
resolv_free_resolution(res);
free(resolvers->id);
free((char *)resolvers->conf.file);
task_destroy(resolvers->t);
- LIST_DEL(&resolvers->list);
+ LIST_DELETE(&resolvers->list);
free(resolvers);
}
list_for_each_entry_safe(srvrq, srvrqback, &resolv_srvrq_list, list) {
free(srvrq->name);
free(srvrq->hostname_dn);
- LIST_DEL(&srvrq->list);
+ LIST_DELETE(&srvrq->list);
free(srvrq);
}
}
curr_resolvers->px = p;
/* default values */
- LIST_ADDQ(&sec_resolvers, &curr_resolvers->list);
+ LIST_APPEND(&sec_resolvers, &curr_resolvers->list);
curr_resolvers->conf.file = strdup(file);
curr_resolvers->conf.line = linenum;
curr_resolvers->id = strdup(args[1]);
newnameserver->process_responses = resolv_process_responses;
newnameserver->conf.line = linenum;
/* the nameservers are linked backward first */
- LIST_ADDQ(&curr_resolvers->nameservers, &newnameserver->list);
+ LIST_APPEND(&curr_resolvers->nameservers, &newnameserver->list);
}
else if (strcmp(args[0], "parse-resolv-conf") == 0) {
struct dns_nameserver *newnameserver = NULL;
newnameserver->parent = curr_resolvers;
newnameserver->process_responses = resolv_process_responses;
newnameserver->conf.line = resolv_linenum;
- LIST_ADDQ(&curr_resolvers->nameservers, &newnameserver->list);
+ LIST_APPEND(&curr_resolvers->nameservers, &newnameserver->list);
}
resolv_out:
if (!si_oc(si)->output && !(si_oc(si)->flags & CF_SHUTW)) {
/* let's be woken up once new data arrive */
HA_RWLOCK_WRLOCK(LOGSRV_LOCK, &ring->lock);
- LIST_ADDQ(&ring->waiters, &appctx->wait_entry);
+ LIST_APPEND(&ring->waiters, &appctx->wait_entry);
HA_RWLOCK_WRUNLOCK(LOGSRV_LOCK, &ring->lock);
si_rx_endp_done(si);
ret = 0;
if (sf->use & (1 << bit))
sf->val |= fetch_cap[bit];
}
- LIST_ADDQ(&sample_fetches.list, &kwl->list);
+ LIST_APPEND(&sample_fetches.list, &kwl->list);
}
/*
*/
void sample_register_convs(struct sample_conv_kw_list *pckl)
{
- LIST_ADDQ(&sample_convs.list, &pckl->list);
+ LIST_APPEND(&sample_convs.list, &pckl->list);
}
/*
if (!conv_expr)
goto out_error;
- LIST_ADDQ(&(expr->conv_exprs), &(conv_expr->list));
+ LIST_APPEND(&(expr->conv_exprs), &(conv_expr->list));
conv_expr->conv = conv;
al->kw = expr->fetch->kw;
}
- LIST_DEL(&cur->list);
+ LIST_DELETE(&cur->list);
free(cur);
} /* end of args processing */
return;
list_for_each_entry_safe(conv_expr, conv_exprb, &expr->conv_exprs, list) {
- LIST_DEL(&conv_expr->list);
+ LIST_DELETE(&conv_expr->list);
release_sample_arg(conv_expr->arg_p);
free(conv_expr);
}
*/
void srv_register_keywords(struct srv_kw_list *kwl)
{
- LIST_ADDQ(&srv_keywords.list, &kwl->list);
+ LIST_APPEND(&srv_keywords.list, &kwl->list);
}
/* Return a pointer to the server keyword <kw>, or NULL if not found. If the
srv->obj_type = OBJ_TYPE_SERVER;
srv->proxy = proxy;
srv->pendconns = EB_ROOT;
- LIST_ADDQ(&servers_list, &srv->global_list);
+ LIST_APPEND(&servers_list, &srv->global_list);
srv->next_state = SRV_ST_RUNNING; /* early server setup */
srv->last_change = now.tv_sec;
}
HA_SPIN_DESTROY(&srv->lock);
- LIST_DEL(&srv->global_list);
+ LIST_DELETE(&srv->global_list);
EXTRA_COUNTERS_FREE(srv->extra_counters);
#endif
free_check(&newsrv->agent);
free_check(&newsrv->check);
- LIST_DEL(&newsrv->global_list);
+ LIST_DELETE(&newsrv->global_list);
}
free(newsrv);
return i - srv->tmpl_info.nb_low;
hash_node = ebmb_entry(node, struct conn_hash_node, node);
eb_delete(node);
- MT_LIST_ADDQ(toremove_list, &hash_node->conn->toremove_list);
+ MT_LIST_APPEND(toremove_list, &hash_node->conn->toremove_list);
i++;
node = next;
cur_block->len = 0;
cur_block->refcount = 0;
cur_block->block_count = 1;
- LIST_ADDQ(&shctx->avail, &cur_block->list);
+ LIST_APPEND(&shctx->avail, &cur_block->list);
shctx->nbav++;
cur += sizeof(struct shared_block) + blocksize;
}
if (sig != SIGPROF)
signal(sig, SIG_DFL);
list_for_each_entry_safe(sh, shb, &signal_state[sig].handlers, list) {
- LIST_DEL(&sh->list);
+ LIST_DELETE(&sh->list);
pool_free(pool_head_sig_handlers, sh);
}
}
sh->handler = fct;
sh->arg = arg;
sh->flags = SIG_F_TYPE_FCT;
- LIST_ADDQ(&signal_state[sig].handlers, &sh->list);
+ LIST_APPEND(&signal_state[sig].handlers, &sh->list);
return sh;
}
sh->handler = task;
sh->arg = reason & ~TASK_WOKEN_ANY;
sh->flags = SIG_F_TYPE_TASK;
- LIST_ADDQ(&signal_state[sig].handlers, &sh->list);
+ LIST_APPEND(&signal_state[sig].handlers, &sh->list);
return sh;
}
*/
void signal_unregister_handler(struct sig_handler *handler)
{
- LIST_DEL(&handler->list);
+ LIST_DELETE(&handler->list);
pool_free(pool_head_sig_handlers, handler);
}
list_for_each_entry_safe(sh, shb, &signal_state[sig].handlers, list) {
if (sh->handler == target) {
- LIST_DEL(&sh->list);
+ LIST_DELETE(&sh->list);
pool_free(pool_head_sig_handlers, sh);
break;
}
return;
list_for_each_entry_safe(sh, shb, &signal_state[sig].handlers, list) {
- LIST_DEL(&sh->list);
+ LIST_DELETE(&sh->list);
pool_free(pool_head_sig_handlers, sh);
}
sink->ctx.fd = -1;
sink->ctx.dropped = 0;
HA_RWLOCK_INIT(&sink->ctx.lock);
- LIST_ADDQ(&sink_list, &sink->sink_list);
+ LIST_APPEND(&sink_list, &sink->sink_list);
end:
return sink;
sink->ctx.ring = ring_new(size);
if (!sink->ctx.ring) {
- LIST_DEL(&sink->sink_list);
+ LIST_DELETE(&sink->sink_list);
free(sink->name);
free(sink->desc);
free(sink);
if (ret) {
/* let's be woken up once new data arrive */
HA_RWLOCK_WRLOCK(LOGSRV_LOCK, &ring->lock);
- LIST_ADDQ(&ring->waiters, &appctx->wait_entry);
+ LIST_APPEND(&ring->waiters, &appctx->wait_entry);
HA_RWLOCK_WRUNLOCK(LOGSRV_LOCK, &ring->lock);
si_rx_endp_done(si);
}
if (ret) {
/* let's be woken up once new data arrive */
HA_RWLOCK_WRLOCK(LOGSRV_LOCK, &ring->lock);
- LIST_ADDQ(&ring->waiters, &appctx->wait_entry);
+ LIST_APPEND(&ring->waiters, &appctx->wait_entry);
HA_RWLOCK_WRUNLOCK(LOGSRV_LOCK, &ring->lock);
si_rx_endp_done(si);
}
/* Error unrolling */
out_free_strm:
- LIST_DEL(&s->list);
+ LIST_DELETE(&s->list);
pool_free(pool_head_stream, s);
out_free_sess:
session_free(sess);
if (sink->ctx.ring)
ring_free(sink->ctx.ring);
- LIST_DEL(&sink->sink_list);
+ LIST_DELETE(&sink->sink_list);
free(sink->name);
free(sink->desc);
free(sink);
list_for_each_entry_safe(sink, sb, &sink_list, sink_list) {
if (sink->type == SINK_TYPE_BUFFER)
ring_free(sink->ctx.ring);
- LIST_DEL(&sink->sink_list);
+ LIST_DELETE(&sink->sink_list);
free(sink->name);
free(sink->desc);
free(sink);
list_for_each_entry_safe(sni, sni_s, &inst->sni_ctx, by_ckch_inst) {
SSL_CTX_free(sni->ctx);
- LIST_DEL(&sni->by_ckch_inst);
+ LIST_DELETE(&sni->by_ckch_inst);
ebmb_delete(&sni->name);
free(sni);
}
SSL_CTX_free(inst->ctx);
inst->ctx = NULL;
- LIST_DEL(&inst->by_ckchs);
- LIST_DEL(&inst->by_crtlist_entry);
+ LIST_DELETE(&inst->by_ckchs);
+ LIST_DELETE(&inst->by_crtlist_entry);
free(inst);
}
/* display one dot per new instance */
chunk_appendf(trash, ".");
/* link the new ckch_inst to the duplicate */
- LIST_ADDQ(&new_ckchs->ckch_inst, &new_inst->by_ckchs);
+ LIST_APPEND(&new_ckchs->ckch_inst, &new_inst->by_ckchs);
y++;
}
appctx->st2 = SETCERT_ST_INSERT;
/* insert the new ckch_insts in the crtlist_entry */
list_for_each_entry(ckchi, &new_ckchs->ckch_inst, by_ckchs) {
if (ckchi->crtlist_entry)
- LIST_ADD(&ckchi->crtlist_entry->ckch_inst, &ckchi->by_crtlist_entry);
+ LIST_INSERT(&ckchi->crtlist_entry->ckch_inst, &ckchi->by_crtlist_entry);
}
/* First, we insert every new SNIs in the trees, also replace the default_ctx */
return;
ebpt_delete(&entry->node);
- LIST_DEL(&entry->by_crtlist);
- LIST_DEL(&entry->by_ckch_store);
+ LIST_DELETE(&entry->by_crtlist);
+ LIST_DELETE(&entry->by_ckch_store);
crtlist_free_filters(entry->filters);
ssl_sock_free_ssl_conf(entry->ssl_conf);
free(entry->ssl_conf);
LIST_INIT(&entry->ckch_inst);
- /* initialize the nodes so we can LIST_DEL in any cases */
+ /* initialize the nodes so we can LIST_DELETE in any cases */
LIST_INIT(&entry->by_crtlist);
LIST_INIT(&entry->by_ckch_store);
entry->node.key = ckchs;
entry->crtlist = newlist;
ebpt_insert(&newlist->entries, &entry->node);
- LIST_ADDQ(&newlist->ord_entries, &entry->by_crtlist);
- LIST_ADDQ(&ckchs->crtlist_entry, &entry->by_ckch_store);
+ LIST_APPEND(&newlist->ord_entries, &entry->by_crtlist);
+ LIST_APPEND(&ckchs->crtlist_entry, &entry->by_ckch_store);
} else if (global_ssl.extra_files & SSL_GF_BUNDLE) {
/* If we didn't find the file, this could be a
entry_dup->node.key = ckchs;
entry_dup->crtlist = newlist;
ebpt_insert(&newlist->entries, &entry_dup->node);
- LIST_ADDQ(&newlist->ord_entries, &entry_dup->by_crtlist);
- LIST_ADDQ(&ckchs->crtlist_entry, &entry_dup->by_ckch_store);
+ LIST_APPEND(&newlist->ord_entries, &entry_dup->by_crtlist);
+ LIST_APPEND(&ckchs->crtlist_entry, &entry_dup->by_ckch_store);
entry_dup = NULL; /* the entry was used, we need a new one next round */
}
entry->node.key = ckchs;
entry->crtlist = newlist;
ebpt_insert(&newlist->entries, &entry->node);
- LIST_ADDQ(&newlist->ord_entries, &entry->by_crtlist);
- LIST_ADDQ(&ckchs->crtlist_entry, &entry->by_ckch_store);
+ LIST_APPEND(&newlist->ord_entries, &entry->by_crtlist);
+ LIST_APPEND(&ckchs->crtlist_entry, &entry->by_ckch_store);
found++;
}
entry = NULL;
}
entry->node.key = ckchs;
entry->crtlist = dir;
- LIST_ADDQ(&ckchs->crtlist_entry, &entry->by_ckch_store);
- LIST_ADDQ(&dir->ord_entries, &entry->by_crtlist);
+ LIST_APPEND(&ckchs->crtlist_entry, &entry->by_ckch_store);
+ LIST_APPEND(&dir->ord_entries, &entry->by_crtlist);
ebpt_insert(&dir->entries, &entry->node);
ignore_entry:
struct ckch_inst *inst, *inst_s;
/* upon error free the ckch_inst and everything inside */
ebpt_delete(&entry->node);
- LIST_DEL(&entry->by_crtlist);
- LIST_DEL(&entry->by_ckch_store);
+ LIST_DELETE(&entry->by_crtlist);
+ LIST_DELETE(&entry->by_ckch_store);
list_for_each_entry_safe(inst, inst_s, &entry->ckch_inst, by_ckchs) {
ckch_inst_free(inst);
/* display one dot for each new instance */
chunk_appendf(trash, ".");
i++;
- LIST_ADDQ(&store->ckch_inst, &new_inst->by_ckchs);
- LIST_ADDQ(&entry->ckch_inst, &new_inst->by_crtlist_entry);
+ LIST_APPEND(&store->ckch_inst, &new_inst->by_ckchs);
+ LIST_APPEND(&entry->ckch_inst, &new_inst->by_crtlist_entry);
new_inst->crtlist_entry = entry;
}
appctx->st2 = SETCERT_ST_INSERT;
goto error;
}
- LIST_ADDQ(&crtlist->ord_entries, &entry->by_crtlist);
+ LIST_APPEND(&crtlist->ord_entries, &entry->by_crtlist);
entry->crtlist = crtlist;
- LIST_ADDQ(&store->crtlist_entry, &entry->by_ckch_store);
+ LIST_APPEND(&store->crtlist_entry, &entry->by_ckch_store);
appctx->st2 = SETCERT_ST_INIT;
appctx->ctx.cli.p0 = crtlist;
/* upon error free the ckch_inst and everything inside */
ebpt_delete(&entry->node);
- LIST_DEL(&entry->by_crtlist);
- LIST_DEL(&entry->by_ckch_store);
+ LIST_DELETE(&entry->by_crtlist);
+ LIST_DELETE(&entry->by_ckch_store);
list_for_each_entry_safe(inst, inst_s, &entry->ckch_inst, by_crtlist_entry) {
struct sni_ctx *sni, *sni_s;
HA_RWLOCK_WRLOCK(SNI_LOCK, &inst->bind_conf->sni_lock);
list_for_each_entry_safe(sni, sni_s, &inst->sni_ctx, by_ckch_inst) {
ebmb_delete(&sni->name);
- LIST_DEL(&sni->by_ckch_inst);
+ LIST_DELETE(&sni->by_ckch_inst);
SSL_CTX_free(sni->ctx);
free(sni);
}
HA_RWLOCK_WRUNLOCK(SNI_LOCK, &inst->bind_conf->sni_lock);
- LIST_DEL(&inst->by_ckchs);
+ LIST_DELETE(&inst->by_ckchs);
free(inst);
}
cbk->func = func;
- LIST_ADDQ(&ssl_sock_msg_callbacks, &cbk->list);
+ LIST_APPEND(&ssl_sock_msg_callbacks, &cbk->list);
return 1;
}
struct ssl_sock_msg_callback *cbk, *cbkback;
list_for_each_entry_safe(cbk, cbkback, &ssl_sock_msg_callbacks, list) {
- LIST_DEL(&cbk->list);
+ LIST_DELETE(&cbk->list);
free(cbk);
}
}
el = calloc(1, sizeof(*el));
el->e = engine;
- LIST_ADD(&openssl_engines, &el->list);
+ LIST_INSERT(&openssl_engines, &el->list);
nb_engines++;
if (global_ssl.async)
global.ssl_used_async_engines = nb_engines;
/* This sort the reference list by id. */
list_for_each_entry_safe(ref, ref2, &tlskeys_reference, list) {
- LIST_DEL(&ref->list);
+ LIST_DELETE(&ref->list);
list_for_each_entry(ref3, &tkr, list) {
if (ref->unique_id < ref3->unique_id) {
- LIST_ADDQ(&ref3->list, &ref->list);
+ LIST_APPEND(&ref3->list, &ref->list);
break;
}
}
if (&ref3->list == &tkr)
- LIST_ADDQ(&tkr, &ref->list);
+ LIST_APPEND(&tkr, &ref->list);
}
/* swap root */
- LIST_ADD(&tkr, &tlskeys_reference);
- LIST_DEL(&tkr);
+ LIST_INSERT(&tkr, &tlskeys_reference);
+ LIST_DELETE(&tkr);
return ERR_NONE;
}
#endif /* SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB */
sc->wild = wild;
sc->name.node.leaf_p = NULL;
sc->ckch_inst = ckch_inst;
- LIST_ADDQ(&ckch_inst->sni_ctx, &sc->by_ckch_inst);
+ LIST_APPEND(&ckch_inst->sni_ctx, &sc->by_ckch_inst);
}
return order;
}
if (sc1->ctx == sc0->ctx && sc1->conf == sc0->conf
&& sc1->neg == sc0->neg && sc1->wild == sc0->wild) {
/* it's a duplicate, we should remove and free it */
- LIST_DEL(&sc0->by_ckch_inst);
+ LIST_DELETE(&sc0->by_ckch_inst);
SSL_CTX_free(sc0->ctx);
ha_free(&sc0);
break;
ssl_sock_load_cert_sni(*ckch_inst, bind_conf);
/* succeed, add the instance to the ckch_store's list of instance */
- LIST_ADDQ(&ckchs->ckch_inst, &((*ckch_inst)->by_ckchs));
+ LIST_APPEND(&ckchs->ckch_inst, &((*ckch_inst)->by_ckchs));
return errcode;
}
SSL_CTX_up_ref((*ckch_inst)->ctx);
server->ssl_ctx.ctx = (*ckch_inst)->ctx;
/* succeed, add the instance to the ckch_store's list of instance */
- LIST_ADDQ(&ckchs->ckch_inst, &((*ckch_inst)->by_ckchs));
+ LIST_APPEND(&ckchs->ckch_inst, &((*ckch_inst)->by_ckchs));
return errcode;
}
memprintf(err, "error processing line %d in file '%s' : %s", entry->linenum, file, *err);
goto error;
}
- LIST_ADDQ(&entry->ckch_inst, &ckch_inst->by_crtlist_entry);
+ LIST_APPEND(&entry->ckch_inst, &ckch_inst->by_crtlist_entry);
ckch_inst->crtlist_entry = entry;
}
back = ebmb_next(node);
ebmb_delete(node);
SSL_CTX_free(sni->ctx);
- LIST_DEL(&sni->by_ckch_inst);
+ LIST_DELETE(&sni->by_ckch_inst);
free(sni);
node = back;
}
back = ebmb_next(node);
ebmb_delete(node);
SSL_CTX_free(sni->ctx);
- LIST_DEL(&sni->by_ckch_inst);
+ LIST_DELETE(&sni->by_ckch_inst);
free(sni);
node = back;
}
if (bind_conf->keys_ref && !--bind_conf->keys_ref->refcount) {
free(bind_conf->keys_ref->filename);
free(bind_conf->keys_ref->tlskeys);
- LIST_DEL(&bind_conf->keys_ref->list);
+ LIST_DELETE(&bind_conf->keys_ref->list);
free(bind_conf->keys_ref);
}
bind_conf->keys_ref = NULL;
list_for_each_entry_safe(wl, wlb, &openssl_engines, list) {
ENGINE_finish(wl->e);
ENGINE_free(wl->e);
- LIST_DEL(&wl->list);
+ LIST_DELETE(&wl->list);
free(wl);
}
}
{
const uint8_t domain = stats_get_domain(m->domain_flags);
- LIST_ADDQ(&stats_module_list[domain], &m->list);
+ LIST_APPEND(&stats_module_list[domain], &m->list);
stat_count[domain] += m->stats_count;
}
s->tunnel_timeout = TICK_ETERNITY;
- LIST_ADDQ(&ti->streams, &s->list);
+ LIST_APPEND(&ti->streams, &s->list);
if (flt_stream_init(s) < 0 || flt_stream_start(s) < 0)
goto out_fail_accept;
flt_stream_release(s, 0);
task_destroy(t);
tasklet_free(s->si[1].wait_event.tasklet);
- LIST_DEL(&s->list);
+ LIST_DELETE(&s->list);
out_fail_alloc_si1:
tasklet_free(s->si[0].wait_event.tasklet);
out_fail_alloc:
put_pipe(s->res.pipe);
/* We may still be present in the buffer wait queue */
- if (LIST_ADDED(&s->buffer_wait.list))
+ if (LIST_INLIST(&s->buffer_wait.list))
LIST_DEL_INIT(&s->buffer_wait.list);
if (s->req.buf.size || s->res.buf.size) {
*/
LIST_DEL_INIT(&bref->users);
if (s->list.n != &ti->streams)
- LIST_ADDQ(&LIST_ELEM(s->list.n, struct stream *, list)->back_refs, &bref->users);
+ LIST_APPEND(&LIST_ELEM(s->list.n, struct stream *, list)->back_refs, &bref->users);
bref->ref = s->list.n;
__ha_barrier_store();
}
- LIST_DEL(&s->list);
+ LIST_DELETE(&s->list);
/* applets do not release session yet */
must_free_sess = objt_appctx(sess->origin) && sess->origin == s->si[0].end;
*/
static int stream_alloc_work_buffer(struct stream *s)
{
- if (LIST_ADDED(&s->buffer_wait.list))
+ if (LIST_INLIST(&s->buffer_wait.list))
LIST_DEL_INIT(&s->buffer_wait.list);
if (b_alloc(&s->res.buf))
return 1;
- LIST_ADDQ(&ti->buffer_wq, &s->buffer_wait.list);
+ LIST_APPEND(&ti->buffer_wq, &s->buffer_wait.list);
return 0;
}
void service_keywords_register(struct action_kw_list *kw_list)
{
- LIST_ADDQ(&service_keywords, &kw_list->list);
+ LIST_APPEND(&service_keywords, &kw_list->list);
}
struct action_kw *service_find(const char *kw)
chunk_appendf(&trash,
" flags=0x%x, conn_retries=%d, srv_conn=%p, pend_pos=%p waiting=%d epoch=%#x\n",
strm->flags, strm->si[1].conn_retries, strm->srv_conn, strm->pend_pos,
- LIST_ADDED(&strm->buffer_wait.list), strm->stream_epoch);
+ LIST_INLIST(&strm->buffer_wait.list), strm->stream_epoch);
chunk_appendf(&trash,
" frontend=%s (id=%u mode=%s), listener=%s (id=%u)",
*/
if (appctx->st2 == STAT_ST_LIST) {
if (!LIST_ISEMPTY(&appctx->ctx.sess.bref.users)) {
- LIST_DEL(&appctx->ctx.sess.bref.users);
+ LIST_DELETE(&appctx->ctx.sess.bref.users);
LIST_INIT(&appctx->ctx.sess.bref.users);
}
}
case STAT_ST_LIST:
/* first, let's detach the back-ref from a possible previous stream */
if (!LIST_ISEMPTY(&appctx->ctx.sess.bref.users)) {
- LIST_DEL(&appctx->ctx.sess.bref.users);
+ LIST_DELETE(&appctx->ctx.sess.bref.users);
LIST_INIT(&appctx->ctx.sess.bref.users);
}
if (appctx->ctx.sess.target != (void *)-1 && appctx->ctx.sess.target != curr_strm)
goto next_sess;
- LIST_ADDQ(&curr_strm->back_refs, &appctx->ctx.sess.bref.users);
+ LIST_APPEND(&curr_strm->back_refs, &appctx->ctx.sess.bref.users);
/* call the proper dump() function and return if we're missing space */
if (!stats_dump_full_strm_to_buffer(si, curr_strm))
goto full;
/* stream dump complete */
- LIST_DEL(&appctx->ctx.sess.bref.users);
+ LIST_DELETE(&appctx->ctx.sess.bref.users);
LIST_INIT(&appctx->ctx.sess.bref.users);
if (appctx->ctx.sess.target != (void *)-1) {
appctx->ctx.sess.target = NULL;
/* let's try again later from this stream. We add ourselves into
* this stream's users so that it can remove us upon termination.
*/
- LIST_ADDQ(&curr_strm->back_refs, &appctx->ctx.sess.bref.users);
+ LIST_APPEND(&curr_strm->back_refs, &appctx->ctx.sess.bref.users);
goto full;
}
*/
thread_isolate();
if (!LIST_ISEMPTY(&appctx->ctx.sess.bref.users))
- LIST_DEL(&appctx->ctx.sess.bref.users);
+ LIST_DELETE(&appctx->ctx.sess.bref.users);
thread_release();
}
}
thr = my_ffsl(t->thread_mask) - 1;
/* Beware: tasks that have never run don't have their ->list empty yet! */
- MT_LIST_ADDQ(&task_per_thread[thr].shared_tasklet_list,
+ MT_LIST_APPEND(&task_per_thread[thr].shared_tasklet_list,
(struct mt_list *)&((struct tasklet *)t)->list);
_HA_ATOMIC_INC(&task_per_thread[thr].rq_total);
_HA_ATOMIC_INC(&task_per_thread[thr].tasks_in_list);
if (likely(thr < 0)) {
/* this tasklet runs on the caller thread */
if (tl->state & TASK_HEAVY) {
- LIST_ADDQ(&sched->tasklets[TL_HEAVY], &tl->list);
+ LIST_APPEND(&sched->tasklets[TL_HEAVY], &tl->list);
sched->tl_class_mask |= 1 << TL_HEAVY;
}
else if (tl->state & TASK_SELF_WAKING) {
- LIST_ADDQ(&sched->tasklets[TL_BULK], &tl->list);
+ LIST_APPEND(&sched->tasklets[TL_BULK], &tl->list);
sched->tl_class_mask |= 1 << TL_BULK;
}
else if ((struct task *)tl == sched->current) {
_HA_ATOMIC_OR(&tl->state, TASK_SELF_WAKING);
- LIST_ADDQ(&sched->tasklets[TL_BULK], &tl->list);
+ LIST_APPEND(&sched->tasklets[TL_BULK], &tl->list);
sched->tl_class_mask |= 1 << TL_BULK;
}
else if (sched->current_queue < 0) {
- LIST_ADDQ(&sched->tasklets[TL_URGENT], &tl->list);
+ LIST_APPEND(&sched->tasklets[TL_URGENT], &tl->list);
sched->tl_class_mask |= 1 << TL_URGENT;
}
else {
- LIST_ADDQ(&sched->tasklets[sched->current_queue], &tl->list);
+ LIST_APPEND(&sched->tasklets[sched->current_queue], &tl->list);
sched->tl_class_mask |= 1 << sched->current_queue;
}
_HA_ATOMIC_INC(&sched->rq_total);
} else {
/* this tasklet runs on a specific thread. */
- MT_LIST_ADDQ(&task_per_thread[thr].shared_tasklet_list, (struct mt_list *)&tl->list);
+ MT_LIST_APPEND(&task_per_thread[thr].shared_tasklet_list, (struct mt_list *)&tl->list);
_HA_ATOMIC_INC(&task_per_thread[thr].rq_total);
if (sleeping_thread_mask & (1UL << thr)) {
_HA_ATOMIC_AND(&sleeping_thread_mask, ~(1UL << thr));
* 100% due to rounding, this is not a problem. Note that while in
* theory the sum cannot be NULL as we cannot get there without tasklets
* to process, in practice it seldom happens when multiple writers
- * conflict and rollback on MT_LIST_TRY_ADDQ(shared_tasklet_list), causing
+ * conflict and rollback on MT_LIST_TRY_APPEND(shared_tasklet_list), causing
* a first MT_LIST_ISEMPTY() to succeed for thread_has_task() and the
* one above to finally fail. This is extremely rare and not a problem.
*/
_HA_ATOMIC_DEC(&niced_tasks);
/* Add it to the local task list */
- LIST_ADDQ(&tt->tasklets[TL_NORMAL], &((struct tasklet *)t)->list);
+ LIST_APPEND(&tt->tasklets[TL_NORMAL], &((struct tasklet *)t)->list);
}
/* release the rqueue lock */
*/
void tcp_req_conn_keywords_register(struct action_kw_list *kw_list)
{
- LIST_ADDQ(&tcp_req_conn_keywords, &kw_list->list);
+ LIST_APPEND(&tcp_req_conn_keywords, &kw_list->list);
}
void tcp_req_sess_keywords_register(struct action_kw_list *kw_list)
{
- LIST_ADDQ(&tcp_req_sess_keywords, &kw_list->list);
+ LIST_APPEND(&tcp_req_sess_keywords, &kw_list->list);
}
void tcp_req_cont_keywords_register(struct action_kw_list *kw_list)
{
- LIST_ADDQ(&tcp_req_cont_keywords, &kw_list->list);
+ LIST_APPEND(&tcp_req_cont_keywords, &kw_list->list);
}
void tcp_res_cont_keywords_register(struct action_kw_list *kw_list)
{
- LIST_ADDQ(&tcp_res_cont_keywords, &kw_list->list);
+ LIST_APPEND(&tcp_res_cont_keywords, &kw_list->list);
}
/*
warn++;
}
- LIST_ADDQ(&curpx->tcp_rep.inspect_rules, &rule->list);
+ LIST_APPEND(&curpx->tcp_rep.inspect_rules, &rule->list);
}
else {
memprintf(err,
/* the following function directly emits the warning */
warnif_misplaced_tcp_cont(curpx, file, line, args[0]);
- LIST_ADDQ(&curpx->tcp_req.inspect_rules, &rule->list);
+ LIST_APPEND(&curpx->tcp_req.inspect_rules, &rule->list);
}
else if (strcmp(args[1], "connection") == 0) {
arg++;
/* the following function directly emits the warning */
warnif_misplaced_tcp_conn(curpx, file, line, args[0]);
- LIST_ADDQ(&curpx->tcp_req.l4_rules, &rule->list);
+ LIST_APPEND(&curpx->tcp_req.l4_rules, &rule->list);
}
else if (strcmp(args[1], "session") == 0) {
arg++;
/* the following function directly emits the warning */
warnif_misplaced_tcp_sess(curpx, file, line, args[0]);
- LIST_ADDQ(&curpx->tcp_req.l5_rules, &rule->list);
+ LIST_APPEND(&curpx->tcp_req.l5_rules, &rule->list);
}
else {
if (curpx == defpx)
struct logformat_node *lf, *lfb;
list_for_each_entry_safe(lf, lfb, fmt, list) {
- LIST_DEL(&lf->list);
+ LIST_DELETE(&lf->list);
release_sample_expr(lf->expr);
free(lf->arg);
free(lf);
struct tcpcheck_http_hdr *hdr, *bhdr;
list_for_each_entry_safe(hdr, bhdr, hdrs, list) {
- LIST_DEL(&hdr->list);
+ LIST_DELETE(&hdr->list);
free_tcpcheck_http_hdr(hdr);
}
}
struct tcpcheck_var *var, *back;
list_for_each_entry_safe(var, back, vars, list) {
- LIST_DEL(&var->list);
+ LIST_DELETE(&var->list);
free_tcpcheck_var(var);
}
}
}
else
new->data.u = var->data.u;
- LIST_ADDQ(dst, &new->list);
+ LIST_APPEND(dst, &new->list);
}
return 1;
ebpt_delete(&rs->node);
free(rs->node.key);
list_for_each_entry_safe(r, rb, &rs->rules, list) {
- LIST_DEL(&r->list);
+ LIST_DELETE(&r->list);
free_tcpcheck(r, 0);
}
free(rs);
ist0(hdrs[i].v);
if (!parse_logformat_string(istptr(hdrs[i].v), px, &hdr->value, 0, SMP_VAL_BE_CHK_RUL, errmsg))
goto error;
- LIST_ADDQ(&chk->send.http.hdrs, &hdr->list);
+ LIST_APPEND(&chk->send.http.hdrs, &hdr->list);
hdr = NULL;
}
old->send.http.flags |= TCPCHK_SND_HTTP_FL_URI_FMT;
LIST_INIT(&old->send.http.uri_fmt);
list_for_each_entry_safe(lf, lfb, &new->send.http.uri_fmt, list) {
- LIST_DEL(&lf->list);
- LIST_ADDQ(&old->send.http.uri_fmt, &lf->list);
+ LIST_DELETE(&lf->list);
+ LIST_APPEND(&old->send.http.uri_fmt, &lf->list);
}
}
free_tcpcheck_http_hdrs(&old->send.http.hdrs);
list_for_each_entry_safe(hdr, bhdr, &new->send.http.hdrs, list) {
- LIST_DEL(&hdr->list);
- LIST_ADDQ(&old->send.http.hdrs, &hdr->list);
+ LIST_DELETE(&hdr->list);
+ LIST_APPEND(&old->send.http.hdrs, &hdr->list);
}
if (!(new->send.http.flags & TCPCHK_SND_HTTP_FL_BODY_FMT) && isttest(new->send.http.body)) {
old->send.http.flags |= TCPCHK_SND_HTTP_FL_BODY_FMT;
LIST_INIT(&old->send.http.body_fmt);
list_for_each_entry_safe(lf, lfb, &new->send.http.body_fmt, list) {
- LIST_DEL(&lf->list);
- LIST_ADDQ(&old->send.http.body_fmt, &lf->list);
+ LIST_DELETE(&lf->list);
+ LIST_APPEND(&old->send.http.body_fmt, &lf->list);
}
}
}
if (r && r->action == TCPCHK_ACT_CONNECT)
r = get_next_tcpcheck_rule(rules, r);
if (!r || r->action != TCPCHK_ACT_SEND)
- LIST_ADD(rules->list, &chk->list);
+ LIST_INSERT(rules->list, &chk->list);
else if (r->send.http.flags & TCPCHK_SND_HTTP_FROM_OPT) {
- LIST_DEL(&r->list);
+ LIST_DELETE(&r->list);
free_tcpcheck(r, 0);
- LIST_ADD(rules->list, &chk->list);
+ LIST_INSERT(rules->list, &chk->list);
}
else {
tcpcheck_overwrite_send_http_rule(r, chk);
if (r && r->action == TCPCHK_ACT_SEND && (r->send.http.flags & TCPCHK_SND_HTTP_FROM_OPT)) {
tcpcheck_overwrite_send_http_rule(r, chk);
free_tcpcheck(chk, 0);
- LIST_DEL(&r->list);
+ LIST_DELETE(&r->list);
r->send.http.flags &= ~TCPCHK_SND_HTTP_FROM_OPT;
chk = r;
}
}
- LIST_ADDQ(rules->list, &chk->list);
+ LIST_APPEND(rules->list, &chk->list);
}
return 1;
}
if (chk && chk->action == TCPCHK_ACT_SEND && (chk->send.http.flags & TCPCHK_SND_HTTP_FROM_OPT)) {
next = get_next_tcpcheck_rule(&px->tcpcheck_rules, chk);
if (next && next->action == TCPCHK_ACT_CONNECT) {
- LIST_DEL(&chk->list);
- LIST_ADD(&next->list, &chk->list);
+ LIST_DELETE(&chk->list);
+ LIST_INSERT(&next->list, &chk->list);
chk->index = next->index;
}
}
ret |= ERR_ALERT | ERR_FATAL;
goto out;
}
- LIST_ADDQ(px->tcpcheck_rules.list, &next->list);
+ LIST_APPEND(px->tcpcheck_rules.list, &next->list);
next->index = chk->index;
}
}
}
chk->action = TCPCHK_ACT_CONNECT;
chk->connect.options = (TCPCHK_OPT_DEFAULT_CONNECT|TCPCHK_OPT_IMPLICIT);
- LIST_ADD(px->tcpcheck_rules.list, &chk->list);
+ LIST_INSERT(px->tcpcheck_rules.list, &chk->list);
}
/* Remove all comment rules. To do so, when a such rule is found, the
case TCPCHK_ACT_COMMENT:
free(comment);
comment = chk->comment;
- LIST_DEL(&chk->list);
+ LIST_DELETE(&chk->list);
free(chk);
break;
case TCPCHK_ACT_CONNECT:
free(node->key);
rs = container_of(node, typeof(*rs), node);
list_for_each_entry_safe(r, rb, &rs->rules, list) {
- LIST_DEL(&r->list);
+ LIST_DELETE(&r->list);
free_tcpcheck(r, 0);
}
free(rs);
if (prev_check->action != TCPCHK_ACT_COMMENT && prev_check->action != TCPCHK_ACT_ACTION_KW)
break;
}
- LIST_ADDQ(rules->list, &tcpcheck->list);
+ LIST_APPEND(rules->list, &tcpcheck->list);
return 1;
}
for (in = strs[i]; (*dst = *in++); dst++);
*dst = 0;
- LIST_ADDQ(rules->list, &tcpcheck->list);
+ LIST_APPEND(rules->list, &tcpcheck->list);
return 1;
}
/* No error: add the tcp-check rule in the list */
chk->index = index;
- LIST_ADDQ(&rs->rules, &chk->list);
+ LIST_APPEND(&rs->rules, &chk->list);
if ((curpx->options2 & PR_O2_CHK_ANY) == PR_O2_TCPCHK_CHK &&
(curpx->tcpcheck_rules.flags & TCPCHK_RULES_PROTO_CHK) == TCPCHK_RULES_TCP_CHK) {
else {
/* mark this ruleset as unused for now */
curpx->tcpcheck_rules.flags |= TCPCHK_RULES_UNUSED_HTTP_RS;
- LIST_ADDQ(&rs->rules, &chk->list);
+ LIST_APPEND(&rs->rules, &chk->list);
}
out:
goto error;
}
chk->index = 0;
- LIST_ADDQ(&rs->rules, &chk->list);
+ LIST_APPEND(&rs->rules, &chk->list);
chk = parse_tcpcheck_expect((char *[]){"tcp-check", "expect", "string", redis_res,
"error-status", "L7STS",
goto error;
}
chk->index = 1;
- LIST_ADDQ(&rs->rules, &chk->list);
+ LIST_APPEND(&rs->rules, &chk->list);
ruleset_found:
rules->list = &rs->rules;
goto error;
}
chk->index = 0;
- LIST_ADDQ(&rs->rules, &chk->list);
+ LIST_APPEND(&rs->rules, &chk->list);
chk = parse_tcpcheck_expect((char *[]){"tcp-check", "expect", "rbinary", "^1[56]",
"min-recv", "5", "ok-status", "L6OK",
goto error;
}
chk->index = 1;
- LIST_ADDQ(&rs->rules, &chk->list);
+ LIST_APPEND(&rs->rules, &chk->list);
ruleset_found:
rules->list = &rs->rules;
var->data.u.str.area = cmd;
var->data.u.str.data = strlen(cmd);
LIST_INIT(&var->list);
- LIST_ADDQ(&rules->preset_vars, &var->list);
+ LIST_APPEND(&rules->preset_vars, &var->list);
cmd = NULL;
var = NULL;
goto error;
}
chk->index = 0;
- LIST_ADDQ(&rs->rules, &chk->list);
+ LIST_APPEND(&rs->rules, &chk->list);
chk = parse_tcpcheck_expect((char *[]){"tcp-check", "expect", "rstring", "^[0-9]{3}[ \r]",
"min-recv", "4",
goto error;
}
chk->index = 1;
- LIST_ADDQ(&rs->rules, &chk->list);
+ LIST_APPEND(&rs->rules, &chk->list);
chk = parse_tcpcheck_expect((char *[]){"tcp-check", "expect", "rstring", "^2[0-9]{2}[ \r]",
"min-recv", "4",
goto error;
}
chk->index = 2;
- LIST_ADDQ(&rs->rules, &chk->list);
+ LIST_APPEND(&rs->rules, &chk->list);
chk = parse_tcpcheck_send((char *[]){"tcp-check", "send-lf", smtp_req, ""},
1, curpx, &rs->rules, file, line, &errmsg);
goto error;
}
chk->index = 3;
- LIST_ADDQ(&rs->rules, &chk->list);
+ LIST_APPEND(&rs->rules, &chk->list);
chk = parse_tcpcheck_expect((char *[]){"tcp-check", "expect", "rstring", "^2[0-9]{2}[- \r]",
"min-recv", "4",
goto error;
}
chk->index = 4;
- LIST_ADDQ(&rs->rules, &chk->list);
+ LIST_APPEND(&rs->rules, &chk->list);
ruleset_found:
rules->list = &rs->rules;
var->data.u.str.area = user;
var->data.u.str.data = strlen(user);
LIST_INIT(&var->list);
- LIST_ADDQ(&rules->preset_vars, &var->list);
+ LIST_APPEND(&rules->preset_vars, &var->list);
user = NULL;
var = NULL;
var->data.type = SMP_T_SINT;
var->data.u.sint = packetlen;
LIST_INIT(&var->list);
- LIST_ADDQ(&rules->preset_vars, &var->list);
+ LIST_APPEND(&rules->preset_vars, &var->list);
var = NULL;
}
else {
goto error;
}
chk->index = 0;
- LIST_ADDQ(&rs->rules, &chk->list);
+ LIST_APPEND(&rs->rules, &chk->list);
chk = parse_tcpcheck_send((char *[]){"tcp-check", "send-binary-lf", pgsql_req, ""},
1, curpx, &rs->rules, file, line, &errmsg);
goto error;
}
chk->index = 1;
- LIST_ADDQ(&rs->rules, &chk->list);
+ LIST_APPEND(&rs->rules, &chk->list);
chk = parse_tcpcheck_expect((char *[]){"tcp-check", "expect", "!rstring", "^E",
"min-recv", "5",
goto error;
}
chk->index = 2;
- LIST_ADDQ(&rs->rules, &chk->list);
+ LIST_APPEND(&rs->rules, &chk->list);
chk = parse_tcpcheck_expect((char *[]){"tcp-check", "expect", "rbinary", "^52000000(08|0A|0C)000000(00|02|03|04|05|06)",
"min-recv", "9",
goto error;
}
chk->index = 3;
- LIST_ADDQ(&rs->rules, &chk->list);
+ LIST_APPEND(&rs->rules, &chk->list);
ruleset_found:
rules->list = &rs->rules;
var->data.u.str.area = hdr;
var->data.u.str.data = 4;
LIST_INIT(&var->list);
- LIST_ADDQ(&rules->preset_vars, &var->list);
+ LIST_APPEND(&rules->preset_vars, &var->list);
hdr = NULL;
var = NULL;
var->data.u.str.area = user;
var->data.u.str.data = strlen(user);
LIST_INIT(&var->list);
- LIST_ADDQ(&rules->preset_vars, &var->list);
+ LIST_APPEND(&rules->preset_vars, &var->list);
user = NULL;
var = NULL;
}
goto error;
}
chk->index = index++;
- LIST_ADDQ(&rs->rules, &chk->list);
+ LIST_APPEND(&rs->rules, &chk->list);
if (mysql_req) {
chk = parse_tcpcheck_send((char *[]){"tcp-check", "send-binary-lf", mysql_req, ""},
goto error;
}
chk->index = index++;
- LIST_ADDQ(&rs->rules, &chk->list);
+ LIST_APPEND(&rs->rules, &chk->list);
}
chk = parse_tcpcheck_expect((char *[]){"tcp-check", "expect", "custom", ""},
}
chk->expect.custom = tcpcheck_mysql_expect_iniths;
chk->index = index++;
- LIST_ADDQ(&rs->rules, &chk->list);
+ LIST_APPEND(&rs->rules, &chk->list);
if (mysql_req) {
chk = parse_tcpcheck_expect((char *[]){"tcp-check", "expect", "custom", ""},
}
chk->expect.custom = tcpcheck_mysql_expect_ok;
chk->index = index++;
- LIST_ADDQ(&rs->rules, &chk->list);
+ LIST_APPEND(&rs->rules, &chk->list);
}
ruleset_found:
goto error;
}
chk->index = 0;
- LIST_ADDQ(&rs->rules, &chk->list);
+ LIST_APPEND(&rs->rules, &chk->list);
chk = parse_tcpcheck_expect((char *[]){"tcp-check", "expect", "rbinary", "^30",
"min-recv", "14",
goto error;
}
chk->index = 1;
- LIST_ADDQ(&rs->rules, &chk->list);
+ LIST_APPEND(&rs->rules, &chk->list);
chk = parse_tcpcheck_expect((char *[]){"tcp-check", "expect", "custom", ""},
1, curpx, &rs->rules, TCPCHK_RULES_LDAP_CHK, file, line, &errmsg);
}
chk->expect.custom = tcpcheck_ldap_expect_bindrsp;
chk->index = 2;
- LIST_ADDQ(&rs->rules, &chk->list);
+ LIST_APPEND(&rs->rules, &chk->list);
ruleset_found:
rules->list = &rs->rules;
goto error;
}
chk->index = 0;
- LIST_ADDQ(&rs->rules, &chk->list);
+ LIST_APPEND(&rs->rules, &chk->list);
chk = parse_tcpcheck_expect((char *[]){"tcp-check", "expect", "custom", "min-recv", "4", ""},
1, curpx, &rs->rules, TCPCHK_RULES_SPOP_CHK, file, line, &errmsg);
}
chk->expect.custom = tcpcheck_spop_expect_agenthello;
chk->index = 1;
- LIST_ADDQ(&rs->rules, &chk->list);
+ LIST_APPEND(&rs->rules, &chk->list);
ruleset_found:
rules->list = &rs->rules;
ist0(tmp_hdrs[i].v);
if (!parse_logformat_string(istptr(tmp_hdrs[i].v), px, &hdr->value, 0, SMP_VAL_BE_CHK_RUL, errmsg))
goto error;
- LIST_ADDQ(&chk->send.http.hdrs, &hdr->list);
+ LIST_APPEND(&chk->send.http.hdrs, &hdr->list);
}
}
goto fail_wl_s;
}
- LIST_ADDQ(li, &wl->list);
+ LIST_APPEND(li, &wl->list);
return 1;
ha_free(&var->data.u.meth.str.area);
size += var->data.u.meth.str.data;
}
- LIST_DEL(&var->l);
+ LIST_DELETE(&var->l);
pool_free(var_pool, var);
size += sizeof(struct var);
return size;
var = pool_alloc(var_pool);
if (!var)
return 0;
- LIST_ADDQ(&vars->head, &var->l);
+ LIST_APPEND(&vars->head, &var->l);
var->name = name;
}
frm->type = QUIC_FT_CRYPTO;
frm->crypto.offset = cf_offset;
frm->crypto.len = cf_len;
- LIST_ADDQ(&qel->pktns->tx.frms, &frm->list);
+ LIST_APPEND(&qel->pktns->tx.frms, &frm->list);
}
return len == 0;
struct quic_conn_ctx *ctx)
{
TRACE_PROTO("Removing frame", QUIC_EV_CONN_PRSAFRM, ctx->conn, frm);
- LIST_DEL(&frm->list);
+ LIST_DELETE(&frm->list);
pool_free(pool_head_quic_tx_frm, frm);
}
pkt = eb64_entry(&node->node, struct quic_tx_packet, pn_node);
*pkt_flags |= pkt->flags;
- LIST_ADD(newly_acked_pkts, &pkt->list);
+ LIST_INSERT(newly_acked_pkts, &pkt->list);
TRACE_PROTO("Removing packet #", QUIC_EV_CONN_PRSAFRM, ctx->conn,, &pkt->pn_node.key);
list_for_each_entry_safe(frm, frmbak, &pkt->frms, list)
qc_treat_acked_tx_frm(frm, ctx);
struct quic_conn_ctx *ctx)
{
TRACE_PROTO("to resend frame", QUIC_EV_CONN_PRSAFRM, ctx->conn, frm);
- LIST_DEL(&frm->list);
- LIST_ADD(&pktns->tx.frms, &frm->list);
+ LIST_DELETE(&frm->list);
+ LIST_INSERT(&pktns->tx.frms, &frm->list);
}
struct quic_tx_packet *pkt, *tmp;
list_for_each_entry_safe(pkt, tmp, pkts, list) {
- LIST_DEL(&pkt->list);
+ LIST_DELETE(&pkt->list);
eb64_delete(&pkt->pn_node);
pool_free(pool_head_quic_tx_packet, pkt);
}
ev.ack.acked = pkt->in_flight_len;
ev.ack.time_sent = pkt->time_sent;
quic_cc_event(&qc->path->cc, &ev);
- LIST_DEL(&pkt->list);
+ LIST_DELETE(&pkt->list);
eb64_delete(&pkt->pn_node);
pool_free(pool_head_quic_tx_packet, pkt);
}
/* Treat the frames of this lost packet. */
list_for_each_entry_safe(frm, frmbak, &pkt->frms, list)
qc_treat_nacked_tx_frm(frm, pktns, ctx);
- LIST_DEL(&pkt->list);
+ LIST_DELETE(&pkt->list);
if (!oldest_lost) {
oldest_lost = newest_lost = pkt;
}
if (tick_is_le(time_sent, now_ms) ||
(int64_t)largest_acked_pn >= pkt->pn_node.key + QUIC_LOSS_PACKET_THRESHOLD) {
eb64_delete(&pkt->pn_node);
- LIST_ADDQ(lost_pkts, &pkt->list);
+ LIST_APPEND(lost_pkts, &pkt->list);
}
else {
pktns->tx.loss_time = tick_first(pktns->tx.loss_time, loss_time_limit);
if (p->in_flight_len)
qc_set_timer(ctx);
TRACE_PROTO("sent pkt", QUIC_EV_CONN_SPPKTS, ctx->conn, p);
- LIST_DEL(&p->list);
+ LIST_DELETE(&p->list);
}
}
return 0;
frm->type = QUIC_FT_HANDSHAKE_DONE;
- LIST_ADDQ(&conn->tx.frms_to_send, &frm->list);
+ LIST_APPEND(&conn->tx.frms_to_send, &frm->list);
}
for (i = 1; i < conn->rx_tps.active_connection_id_limit; i++) {
goto err;
quic_connection_id_to_frm_cpy(frm, cid);
- LIST_ADDQ(&conn->tx.frms_to_send, &frm->list);
+ LIST_APPEND(&conn->tx.frms_to_send, &frm->list);
}
return 1;
*/
pkt->odcid_len = dcid_len;
/* Enqueue this packet. */
- LIST_ADDQ(&l->rx.qpkts, &pkt->rx_list);
+ LIST_APPEND(&l->rx.qpkts, &pkt->rx_list);
/* Try to accept a new connection. */
listener_accept(l);
if (!qc->conn) {
room -= cflen;
if (dlen == cf->crypto.len) {
/* <cf> CRYPTO data have been consumed. */
- LIST_DEL(&cf->list);
- LIST_ADDQ(&pkt->frms, &cf->list);
+ LIST_DELETE(&cf->list);
+ LIST_APPEND(&pkt->frms, &cf->list);
}
else {
struct quic_tx_frm *new_cf;
new_cf->type = QUIC_FT_CRYPTO;
new_cf->crypto.len = dlen;
new_cf->crypto.offset = cf->crypto.offset;
- LIST_ADDQ(&pkt->frms, &new_cf->list);
+ LIST_APPEND(&pkt->frms, &new_cf->list);
/* Consume <dlen> bytes of the current frame. */
cf->crypto.len -= dlen;
cf->crypto.offset += dlen;
struct quic_tx_frm *frm, *frmbak;
list_for_each_entry_safe(frm, frmbak, &pkt->frms, list) {
- LIST_DEL(&frm->list);
+ LIST_DELETE(&frm->list);
pool_free(pool_head_quic_tx_frm, frm);
}
pool_free(pool_head_quic_tx_packet, pkt);
/* Increment the number of bytes in <buf> buffer by the length of this packet. */
buf->data += pkt_len;
/* Attach this packet to <buf>. */
- LIST_ADDQ(&buf->pkts, &pkt->list);
+ LIST_APPEND(&buf->pkts, &pkt->list);
TRACE_LEAVE(QUIC_EV_CONN_HPKT, qc->conn, pkt);
return pkt_len;
break;
}
- LIST_DEL(&frm->list);
- LIST_ADDQ(&pkt->frms, &frm->list);
+ LIST_DELETE(&frm->list);
+ LIST_APPEND(&pkt->frms, &frm->list);
pos = ppos;
}
/* Increment the number of bytes in <buf> buffer by the length of this packet. */
wbuf->data += pkt_len;
/* Attach this packet to <buf>. */
- LIST_ADDQ(&wbuf->pkts, &pkt->list);
+ LIST_APPEND(&wbuf->pkts, &pkt->list);
TRACE_LEAVE(QUIC_EV_CONN_PAPKT, qc->conn, pkt);
case 0:
lol = malloc(sizeof(*lol));
MT_LIST_INIT(&lol->list_elt);
- MT_LIST_TRY_ADD(&pouet_list, &lol->list_elt);
+ MT_LIST_TRY_INSERT(&pouet_list, &lol->list_elt);
break;
case 1:
lol = malloc(sizeof(*lol));
MT_LIST_INIT(&lol->list_elt);
- MT_LIST_TRY_ADDQ(&pouet_list, &lol->list_elt);
+ MT_LIST_TRY_APPEND(&pouet_list, &lol->list_elt);
break;
case 2:
{
if (random() % 2) {
- MT_LIST_DEL_SAFE(elt1);
+ MT_LIST_DELETE_SAFE(elt1);
free(lol);
}
if (random() % 2) {