diff options
author | dimitri staessens <[email protected]> | 2016-10-23 23:00:15 +0200 |
---|---|---|
committer | dimitri staessens <[email protected]> | 2016-10-23 23:00:15 +0200 |
commit | b23e3024d12c28b01426cc37d5adf03f9c1bea88 (patch) | |
tree | e90bb2280b28d547c229529abe5f54bfc8837e34 /src/lib/sockets.c | |
parent | a4889a6f1e9f3d3c6822c403ac4fa544618a8c34 (diff) | |
download | ouroboros-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/lib/sockets.c')
-rw-r--r-- | src/lib/sockets.c | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/src/lib/sockets.c b/src/lib/sockets.c index db1f3f6b..a1517b7b 100644 --- a/src/lib/sockets.c +++ b/src/lib/sockets.c @@ -153,39 +153,6 @@ static irm_msg_t * send_recv_irm_msg_timed(irm_msg_t * msg, bool timed) return recv_msg; } -void send_irm_msg(irm_msg_t * msg) -{ - int sockfd; - buffer_t buf; - - sockfd = client_socket_open(IRM_SOCK_PATH); - if (sockfd < 0) - return; - - buf.len = irm_msg__get_packed_size(msg); - if (buf.len == 0) { - close(sockfd); - return; - } - - buf.data = malloc(buf.len); - if (buf.data == NULL) { - close(sockfd); - return; - } - - pthread_cleanup_push(close_ptr, &sockfd); - pthread_cleanup_push((void (*)(void *)) free, (void *) buf.data); - - irm_msg__pack(msg, buf.data); - - if (write(sockfd, buf.data, buf.len) < 0) - return; - - pthread_cleanup_pop(true); - pthread_cleanup_pop(true); -} - irm_msg_t * send_recv_irm_msg(irm_msg_t * msg) { return send_recv_irm_msg_timed(msg, true); } |