diff options
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/lib/dev.c | 2 | ||||
-rw-r--r-- | src/tools/oping/oping_client.c | 7 |
3 files changed, 7 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 02e67be8..46260e90 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ include(GNUInstallDirs) set(PACKAGE_VERSION_MAJOR 0) set(PACKAGE_VERSION_MINOR 10) -set(PACKAGE_VERSION_PATCH 5) +set(PACKAGE_VERSION_PATCH 6) set(PACKAGE_NAME "${CMAKE_PROJECT_NAME}") set(PACKAGE_DESCRIPTION "The Ouroboros prototype") diff --git a/src/lib/dev.c b/src/lib/dev.c index 7e829a5f..2e128d59 100644 --- a/src/lib/dev.c +++ b/src/lib/dev.c @@ -890,7 +890,7 @@ ssize_t flow_read(int fd, flow = &ai.flows[fd]; - clock_gettime(CLOCK_REALTIME_COARSE, &now); + clock_gettime(PTHREAD_COND_CLOCK, &now); pthread_rwlock_rdlock(&ai.lock); diff --git a/src/tools/oping/oping_client.c b/src/tools/oping/oping_client.c index dbbbfa19..6f874dd9 100644 --- a/src/tools/oping/oping_client.c +++ b/src/tools/oping/oping_client.c @@ -55,7 +55,7 @@ void shutdown_client(int signo, siginfo_t * info, void * c) void * reader(void * o) { - struct timespec timeout = {2, 0}; + struct timespec timeout = {client.interval / 1000 + 2, 0}; struct timespec now = {0, 0}; struct timespec sent; @@ -70,8 +70,11 @@ void * reader(void * o) while (!stop && client.rcvd != client.count) { msg_len = flow_read(fd, buf, OPING_BUF_SIZE); - if (msg_len == -ETIMEDOUT) + if (msg_len == -ETIMEDOUT) { + printf("Server timed out.\n"); + stop = true; break; + } if (msg_len < 0) continue; |