diff options
Diffstat (limited to 'src/tools/oping/oping_client.c')
-rw-r--r-- | src/tools/oping/oping_client.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/tools/oping/oping_client.c b/src/tools/oping/oping_client.c index d0255b7c..7b03c83d 100644 --- a/src/tools/oping/oping_client.c +++ b/src/tools/oping/oping_client.c @@ -1,10 +1,10 @@ /* - * Ouroboros - Copyright (C) 2016 - 2020 + * Ouroboros - Copyright (C) 2016 - 2024 * * Ouroboros ping application * - * Dimitri Staessens <dimitri.staessens@ugent.be> - * Sander Vrijders <sander.vrijders@ugent.be> + * Dimitri Staessens <dimitri@ouroboros.rocks> + * Sander Vrijders <sander@ouroboros.rocks> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -163,7 +163,7 @@ void * writer(void * o) printf("Pinging %s with %d bytes of data (%u packets):\n\n", client.s_apn, client.size, client.count); - pthread_cleanup_push((void (*) (void *)) free, buf); + pthread_cleanup_push(free, buf); while (!stop && client.sent < client.count) { nanosleep(&wait, NULL); @@ -177,9 +177,7 @@ void * writer(void * o) if (flow_write(*fdp, buf, client.size) < 0) { printf("Failed to send packet.\n"); - flow_dealloc(*fdp); - free(buf); - return (void *) -1; + stop = true; } } @@ -234,7 +232,7 @@ static int client_main(void) fd = flow_alloc(client.s_apn, &client.qs, NULL); if (fd < 0) { - printf("Failed to allocate flow.\n"); + printf("Failed to allocate flow: %d.\n", fd); client_fini(); return -1; } |