diff options
author | dimitri staessens <dimitri.staessens@ugent.be> | 2017-03-30 20:33:22 +0200 |
---|---|---|
committer | dimitri staessens <dimitri.staessens@ugent.be> | 2017-03-31 11:51:33 +0200 |
commit | 7ba0fd0ce19244745c8d2512ce8a003783d914a7 (patch) | |
tree | e33ed7dae832ef96cd1997ec038764fac5d95d4c /src/ipcpd | |
parent | bce97d70ce43290f8351f34c763b30bfd73e6b99 (diff) | |
download | ouroboros-7ba0fd0ce19244745c8d2512ce8a003783d914a7.tar.gz ouroboros-7ba0fd0ce19244745c8d2512ce8a003783d914a7.zip |
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.
Diffstat (limited to 'src/ipcpd')
-rw-r--r-- | src/ipcpd/normal/connmgr.c | 15 |
1 files changed, 2 insertions, 13 deletions
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); |