summaryrefslogtreecommitdiff
path: root/src/irmd
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@intec.ugent.be>2016-10-26 18:17:36 +0000
committerSander Vrijders <sander.vrijders@intec.ugent.be>2016-10-26 18:17:36 +0000
commit6c2164a59ce4d3ed91a65326ac89bb247e9f622f (patch)
tree7f9a78e0d57f95d903bcbbf01a00e71482593277 /src/irmd
parent7848ec4100f8677392fb6b07c42dd47ee6aa9b0d (diff)
parent963537079c7d5a9f9fb39355fb0e3b84a78eaa0b (diff)
downloadouroboros-6c2164a59ce4d3ed91a65326ac89bb247e9f622f.tar.gz
ouroboros-6c2164a59ce4d3ed91a65326ac89bb247e9f622f.zip
Merged in dstaesse/ouroboros/be-more_flow_alloc (pull request #285)
lib, ipcpd: Further stabilization of flows
Diffstat (limited to 'src/irmd')
-rw-r--r--src/irmd/main.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/irmd/main.c b/src/irmd/main.c
index 1ac989de..548ab1db 100644
--- a/src/irmd/main.c
+++ b/src/irmd/main.c
@@ -1026,6 +1026,8 @@ static struct irm_flow * flow_accept(pid_t api, char ** dst_ae_name)
if (dst_ae_name != NULL)
*dst_ae_name = re->req_ae_name;
+ LOG_INFO("Flow on port_id %d allocated.", f->port_id);
+
pthread_rwlock_unlock(&irmd->flows_lock);
pthread_rwlock_unlock(&irmd->state_lock);
@@ -1156,7 +1158,7 @@ static struct irm_flow * flow_alloc(pid_t api,
pthread_rwlock_wrlock(&irmd->flows_lock);
port_id = f->port_id = bmp_allocate(irmd->port_ids);
- if (!bmp_is_id_valid(irmd->port_ids, (ssize_t) port_id)) {
+ if (!bmp_is_id_valid(irmd->port_ids, port_id)) {
pthread_rwlock_unlock(&irmd->flows_lock);
pthread_rwlock_unlock(&irmd->state_lock);
LOG_ERR("Could not allocate port_id.");
@@ -1233,6 +1235,7 @@ static int flow_alloc_res(int port_id)
}
if (irm_flow_get_state(f) == FLOW_ALLOCATED) {
+ LOG_INFO("Flow on port_id %d allocated.", port_id);
pthread_rwlock_unlock(&irmd->flows_lock);
pthread_rwlock_unlock(&irmd->state_lock);
return 0;
@@ -1348,7 +1351,6 @@ static struct irm_flow * flow_req_arr(pid_t api,
struct pid_el * c_api;
pid_t h_api = -1;
- int port_id = -1;
LOG_DBGF("Flow req arrived from IPCP %d for %s on AE %s.",
api, dst_name, ae_name);
@@ -1467,7 +1469,7 @@ static struct irm_flow * flow_req_arr(pid_t api,
pthread_rwlock_unlock(&irmd->reg_lock);
pthread_rwlock_wrlock(&irmd->flows_lock);
- port_id = f->port_id = bmp_allocate(irmd->port_ids);
+ f->port_id = bmp_allocate(irmd->port_ids);
if (!bmp_is_id_valid(irmd->port_ids, f->port_id)) {
pthread_rwlock_unlock(&irmd->flows_lock);
pthread_rwlock_unlock(&irmd->state_lock);
@@ -1532,8 +1534,6 @@ static struct irm_flow * flow_req_arr(pid_t api,
pthread_mutex_unlock(&re->state_lock);
- LOG_INFO("Flow on port_id %d allocated.", port_id);
-
return f;
}