From 7ba0fd0ce19244745c8d2512ce8a003783d914a7 Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Thu, 30 Mar 2017 20:33:22 +0200 Subject: lib: Revise flow allocation API The flow_alloc_res and flow_alloc_resp calls have been removed. The flow_alloc and flow_accept calls are now both blocking and take an additional timeout argument. --- src/ipcpd/normal/connmgr.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'src/ipcpd/normal/connmgr.c') diff --git a/src/ipcpd/normal/connmgr.c b/src/ipcpd/normal/connmgr.c index b8314917..8068d173 100644 --- a/src/ipcpd/normal/connmgr.c +++ b/src/ipcpd/normal/connmgr.c @@ -126,18 +126,13 @@ static void * flow_acceptor(void * o) pthread_rwlock_unlock(&ipcpi.state_lock); - fd = flow_accept(&qs); + fd = flow_accept(&qs, NULL); if (fd < 0) { if (fd != -EIRMD) log_warn("Flow accept failed: %d", fd); continue; } - if (flow_alloc_resp(fd, 0)) { - log_err("Failed to respond to flow alloc request."); - continue; - } - if (cacep_rcv(fd, &rcv_info)) { log_err("Error establishing application connection."); flow_dealloc(fd); @@ -286,7 +281,7 @@ int connmgr_alloc(struct ae * ae, memset(&conn->conn_info, 0, sizeof(conn->conn_info)); - conn->flow_info.fd = flow_alloc(dst_name, qs); + conn->flow_info.fd = flow_alloc(dst_name, qs, NULL); if (conn->flow_info.fd < 0) { log_err("Failed to allocate flow to %s.", dst_name); return -1; @@ -297,12 +292,6 @@ int connmgr_alloc(struct ae * ae, else memset(&conn->flow_info.qs, 0, sizeof(conn->flow_info.qs)); - if (flow_alloc_res(conn->flow_info.fd)) { - log_err("Flow allocation to %s failed.", dst_name); - flow_dealloc(conn->flow_info.fd); - return -1; - } - if (cacep_snd(conn->flow_info.fd, &ae->info)) { log_err("Failed to create application connection."); flow_dealloc(conn->flow_info.fd); -- cgit v1.2.3