summaryrefslogtreecommitdiff
path: root/src/irmd/main.c
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@intec.ugent.be>2016-10-23 23:00:15 +0200
committerdimitri staessens <dimitri.staessens@intec.ugent.be>2016-10-23 23:00:15 +0200
commitb23e3024d12c28b01426cc37d5adf03f9c1bea88 (patch)
treee90bb2280b28d547c229529abe5f54bfc8837e34 /src/irmd/main.c
parenta4889a6f1e9f3d3c6822c403ac4fa544618a8c34 (diff)
downloadouroboros-b23e3024d12c28b01426cc37d5adf03f9c1bea88.tar.gz
ouroboros-b23e3024d12c28b01426cc37d5adf03f9c1bea88.zip
lib: Stabilise flow allocation
Deallocation was reverted to a synchronoous operation between the AP, IRMd and IPCP in order to avoid inconsistent states of the port_id. Fixes some memory leaks, particularly the shm_flow_set is now closed upon deallocation.
Diffstat (limited to 'src/irmd/main.c')
-rw-r--r--src/irmd/main.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/irmd/main.c b/src/irmd/main.c
index 390681a8..3884a9a7 100644
--- a/src/irmd/main.c
+++ b/src/irmd/main.c
@@ -1929,10 +1929,9 @@ void * mainloop(void * o)
ret_msg.result = flow_alloc_res(msg->port_id);
break;
case IRM_MSG_CODE__IRM_FLOW_DEALLOC:
- flow_dealloc(msg->api, msg->port_id);
- irm_msg__free_unpacked(msg, NULL);
- close(cli_sockfd);
- continue;
+ ret_msg.has_result = true;
+ ret_msg.result = flow_dealloc(msg->api, msg->port_id);
+ break;
case IRM_MSG_CODE__IPCP_FLOW_REQ_ARR:
e = flow_req_arr(msg->api,
msg->dst_name,