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/tools/operf/operf_client.c | 8 +------- src/tools/operf/operf_server.c | 8 +------- 2 files changed, 2 insertions(+), 14 deletions(-) (limited to 'src/tools/operf') diff --git a/src/tools/operf/operf_client.c b/src/tools/operf/operf_client.c index d2f08ef4..7827b62b 100644 --- a/src/tools/operf/operf_client.c +++ b/src/tools/operf/operf_client.c @@ -182,18 +182,12 @@ int client_main(void) client.sent = 0; client.rcvd = 0; - fd = flow_alloc(client.s_apn, NULL); + fd = flow_alloc(client.s_apn, NULL, NULL); if (fd < 0) { printf("Failed to allocate flow.\n"); return -1; } - if (flow_alloc_res(fd)) { - printf("Flow allocation refused.\n"); - flow_dealloc(fd); - return -1; - } - clock_gettime(CLOCK_REALTIME, &tic); pthread_create(&client.reader_pt, NULL, reader, &fd); diff --git a/src/tools/operf/operf_server.c b/src/tools/operf/operf_server.c index 3665d4cc..b17a4f7b 100644 --- a/src/tools/operf/operf_server.c +++ b/src/tools/operf/operf_server.c @@ -108,7 +108,7 @@ void * accept_thread(void * o) printf("Ouroboros perf server started.\n"); while (true) { - fd = flow_accept(&qs); + fd = flow_accept(&qs, NULL); if (fd < 0) { printf("Failed to accept flow.\n"); break; @@ -116,12 +116,6 @@ void * accept_thread(void * o) printf("New flow %d.\n", fd); - if (flow_alloc_resp(fd, 0)) { - printf("Failed to give an allocate response.\n"); - flow_dealloc(fd); - continue; - } - clock_gettime(CLOCK_REALTIME, &now); pthread_mutex_lock(&server.lock); -- cgit v1.2.3