diff options
Diffstat (limited to 'src/tools/oecho/oecho.c')
| -rw-r--r-- | src/tools/oecho/oecho.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/tools/oecho/oecho.c b/src/tools/oecho/oecho.c index cc173988..d5d03027 100644 --- a/src/tools/oecho/oecho.c +++ b/src/tools/oecho/oecho.c @@ -1,10 +1,10 @@ /* - * Ouroboros - Copyright (C) 2016 - 2018 + * Ouroboros - Copyright (C) 2016 - 2024 * * A simple echo 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 @@ -72,15 +72,15 @@ static int server_main(void) count = flow_read(fd, &buf, BUF_SIZE); if (count < 0) { - printf("Failed to read SDU.\n"); + printf("Failed to read packet.\n"); flow_dealloc(fd); continue; } printf("Message from client is %.*s.\n", (int) count, buf); - if (flow_write(fd, buf, count) == -1) { - printf("Failed to write SDU.\n"); + if (flow_write(fd, buf, count) < 0) { + printf("Failed to write packet.\n"); flow_dealloc(fd); continue; } @@ -93,10 +93,10 @@ static int server_main(void) static int client_main(void) { - int fd = 0; + int fd; char buf[BUF_SIZE]; char * message = "Client says hi!"; - ssize_t count = 0; + ssize_t count; fd = flow_alloc("oecho", NULL, NULL); if (fd < 0) { @@ -105,14 +105,14 @@ static int client_main(void) } if (flow_write(fd, message, strlen(message) + 1) < 0) { - printf("Failed to write SDU.\n"); + printf("Failed to write packet.\n"); flow_dealloc(fd); return -1; } count = flow_read(fd, buf, BUF_SIZE); if (count < 0) { - printf("Failed to read SDU.\n"); + printf("Failed to read packet.\n"); flow_dealloc(fd); return -1; } |
