From 05a59c772c5ac88fbcd6dd1d14f239c8a541f532 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Thu, 4 May 2017 12:04:58 +0200 Subject: [PATCH 1/2] [update] verbose fix for ping flag --- central-manager/lib/local/handler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/central-manager/lib/local/handler.c b/central-manager/lib/local/handler.c index cf101b3..f4f1e3a 100644 --- a/central-manager/lib/local/handler.c +++ b/central-manager/lib/local/handler.c @@ -392,7 +392,7 @@ void* manageCtrlTerm(void* THREADABLE_ARGS){ fbk = request.flags&TERMREQ_FBK; if( !( update || fbk ) ){ send(arg->socket, "\x00\0", sizeof(char)*2, 0); - printf("{udp_cterm}{com}(%d) Invalid flag, passing\n", index); + printf("{udp_cterm}{com}(%d) Empty flag (might be a ping), passing\n", index); continue; } From 5b7d7d5c80b77b6f5f7bc380909903fa9580cd44 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Thu, 4 May 2017 12:10:55 +0200 Subject: [PATCH 2/2] [update] verbose timeout set up for udp COM sockets --- central-manager/lib/local/middleware.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/central-manager/lib/local/middleware.c b/central-manager/lib/local/middleware.c index 3c425c6..37ee5cb 100644 --- a/central-manager/lib/local/middleware.c +++ b/central-manager/lib/local/middleware.c @@ -95,11 +95,18 @@ int multicastTerminal(struct middleware_arg* arg){ /* 3. On définit un timeout (si aucune connection) */ /* 3.1. Si viewTerm -> default timeout (4sec) */ - if( strcmp(arg->entity, "udp_vterm") == 0 ) - setTimeout(*arg->comSock, SOCK_TIMEOUT, TIMEOUT_RECV|TIMEOUT_SEND); + if( strcmp(arg->entity, "udp_vterm") == 0 ){ + if( setTimeout(*arg->comSock, SOCK_TIMEOUT, TIMEOUT_RECV|TIMEOUT_SEND) < 0 ){ + if( DEBUGMOD&SCK ) printf("{%s} Cannot set RECV not SEND timeout\n", arg->entity); + }else + if( DEBUGMOD&SCK ) printf("{%s} SEND/RECV timeout set to %d\n", arg->entity, SOCK_TIMEOUT); /* 3.2. Si ctrlTerm -> 10sec timeout */ - else - setTimeout(*arg->comSock, CTRL_TIMEOUT, TIMEOUT_RECV|TIMEOUT_SEND); + }else + if( setTimeout(*arg->comSock, CTRL_TIMEOUT, TIMEOUT_RECV|TIMEOUT_SEND) < 0 ){ + if( DEBUGMOD&SCK ) printf("{%s} Cannot set RECV not SEND timeout\n", arg->entity); + }else + if( DEBUGMOD&SCK ) printf("{%s} SEND/RECV timeout set to %d\n", arg->entity, CTRL_TIMEOUT); +