diff options
author | dimitri staessens <[email protected]> | 2016-10-26 19:30:52 +0200 |
---|---|---|
committer | dimitri staessens <[email protected]> | 2016-10-26 20:09:21 +0200 |
commit | 963537079c7d5a9f9fb39355fb0e3b84a78eaa0b (patch) | |
tree | 7f9a78e0d57f95d903bcbbf01a00e71482593277 /src/irmd/main.c | |
parent | 7848ec4100f8677392fb6b07c42dd47ee6aa9b0d (diff) | |
download | ouroboros-963537079c7d5a9f9fb39355fb0e3b84a78eaa0b.tar.gz ouroboros-963537079c7d5a9f9fb39355fb0e3b84a78eaa0b.zip |
lib, ipcpd: Further stabilization of flows
The steps for flow deallocation have been further refined. An
operation ipcp_flow_fini() which wait for all SDUs to be read from a
flow has been added. The shim IPCPs and the local IPCP have been
adapted to this new API.
Deallocation messages have been removed from the shim IPCPs, since
there is insufficient state synchronisation between them to make this
work reliably.
Diffstat (limited to 'src/irmd/main.c')
-rw-r--r-- | src/irmd/main.c | 10 |
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; } |