summaryrefslogtreecommitdiff
path: root/src/irmd/registry.c
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@intec.ugent.be>2017-02-05 12:09:45 +0000
committerSander Vrijders <sander.vrijders@intec.ugent.be>2017-02-05 12:09:45 +0000
commite8082dbffdcb89e7762231e0548cf72c69fbfcca (patch)
tree96e97ca4e3c4dbeb83bf2851cdc41442e7f0720d /src/irmd/registry.c
parente3b1288354349edc53c7c3c9ebd3efe23a7df10d (diff)
parent49fb847ff3dc8b7de91eb3a54524e60b145f9bf4 (diff)
downloadouroboros-e8082dbffdcb89e7762231e0548cf72c69fbfcca.tar.gz
ouroboros-e8082dbffdcb89e7762231e0548cf72c69fbfcca.zip
Merged in dstaesse/ouroboros/be-wip (pull request #360)
Be wip
Diffstat (limited to 'src/irmd/registry.c')
-rw-r--r--src/irmd/registry.c34
1 files changed, 24 insertions, 10 deletions
diff --git a/src/irmd/registry.c b/src/irmd/registry.c
index 7e21375e..fec69cfa 100644
--- a/src/irmd/registry.c
+++ b/src/irmd/registry.c
@@ -296,6 +296,29 @@ int reg_entry_add_api(struct reg_entry * e, pid_t api)
return 0;
}
+static void reg_entry_check_state(struct reg_entry * e)
+{
+ if (list_is_empty(&e->reg_apis)) {
+ if (!list_is_empty(&e->reg_apns))
+ e->state = REG_NAME_AUTO_ACCEPT;
+ else
+ e->state = REG_NAME_IDLE;
+ } else {
+ e->state = REG_NAME_FLOW_ACCEPT;
+ }
+
+ pthread_cond_broadcast(&e->state_cond);
+}
+
+void reg_entry_del_pid_el(struct reg_entry * e,
+ struct pid_el * p)
+{
+ list_del(&p->next);
+ free(p);
+
+ reg_entry_check_state(e);
+}
+
void reg_entry_del_api(struct reg_entry * e, pid_t api)
{
struct list_head * p;
@@ -312,16 +335,7 @@ void reg_entry_del_api(struct reg_entry * e, pid_t api)
}
}
- if (list_is_empty(&e->reg_apis)) {
- if (!list_is_empty(&e->reg_apns))
- e->state = REG_NAME_AUTO_ACCEPT;
- else
- e->state = REG_NAME_IDLE;
- } else {
- e->state = REG_NAME_FLOW_ACCEPT;
- }
-
- pthread_cond_broadcast(&e->state_cond);
+ reg_entry_check_state(e);
}
pid_t reg_entry_get_api(struct reg_entry * e)