From 2c8e29ca7a997c5aa9d34e3fa956b120a0bbf20c Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Thu, 18 Aug 2016 14:22:06 +0200 Subject: ipcpd: normal: Handle enrollment replies This adds a condition variable with a timeout to the CDAP request so that we can respond correctly to the answer from the remote. It also adds a timeout to the condition variable waiting on completion of enrollment. Furthermore, for every CDAP callback a new thread is now spawned, to avoid deadlocking in case a callback is stuck. --- include/ouroboros/config.h.in | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/ouroboros/config.h.in b/include/ouroboros/config.h.in index d5af0c71..84d56e85 100644 --- a/include/ouroboros/config.h.in +++ b/include/ouroboros/config.h.in @@ -41,15 +41,19 @@ #define SHM_DU_MAP_FILENAME "/ouroboros.shm" #define LOCKFILE_NAME "/ouroboros.lockfile" #define SHM_BUFFER_SIZE (1 << 14) -#define SHM_DU_TIMEOUT_MICROS 15000 #define DU_BUFF_HEADSPACE 128 #define DU_BUFF_TAILSPACE 0 #define SHM_AP_RBUFF_PREFIX "/ouroboros.rbuff." #define IRMD_MAX_FLOWS 4096 #define IRMD_THREADPOOL_SIZE 5 -#define IRMD_ACCEPT_TIMEOUT 100 /* ms */ -#define IRMD_FLOW_TIMEOUT 5000 /* ms */ #define LOG_DIR "/@LOG_DIR@/" -#define SOCKET_TIMEOUT 2000 /* ms */ +#define PTHREAD_COND_CLOCK CLOCK_MONOTONIC +/* Timeout values */ +#define SHM_DU_TIMEOUT_MICROS 15000 +#define IRMD_ACCEPT_TIMEOUT 100 +#define IRMD_FLOW_TIMEOUT 5000 +#define SOCKET_TIMEOUT 4000 +#define CDAP_REPLY_TIMEOUT 1000 +#define ENROLL_TIMEOUT 2000 #endif -- cgit v1.2.3