diff options
author | 2019-04-11 15:35:38 +0300 | |
---|---|---|
committer | 2019-04-11 15:35:38 +0300 | |
commit | bb8babc044e9a13a51016be397b51211c4fa1fab (patch) | |
tree | 619275b946664d4e8438ac44073bb120d5d6b3db /src | |
parent | a45ac4e5bc248a733f289d8a023c332f2b1872b0 (diff) | |
download | usurpation-bb8babc044e9a13a51016be397b51211c4fa1fab.tar.gz usurpation-bb8babc044e9a13a51016be397b51211c4fa1fab.tar.bz2 usurpation-bb8babc044e9a13a51016be397b51211c4fa1fab.zip |
daemon: honour the verbose flag for diagnostics.
Signed-off-by: Gediminas Jakutis <gediminas@varciai.lt>
Diffstat (limited to 'src')
-rw-r--r-- | src/daemon/net.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/daemon/net.c b/src/daemon/net.c index 27375e3..3b4f022 100644 --- a/src/daemon/net.c +++ b/src/daemon/net.c @@ -32,6 +32,7 @@ #include <string.h> #include <stdlib.h> #include <limits.h> +#include "settings.h" #include "net.h" struct netstate { @@ -175,7 +176,7 @@ static void *dolisten(void * state) if (st->data[0] == 'I' && !(strcmp(st->data, servermagic))) { sendto(st->sock, clientmagic, sizeof(clientmagic), MSG_DONTWAIT, (struct sockaddr *) &clientaddr, sizeof(clientaddr)); - //fprintf(stderr, "Sending DATA, timestap: %li \n", st->lastreply.tv_sec); + setting_verbose() ? fprintf(stderr, "Sending DATA, timestap: %li \n", st->lastreply.tv_sec) : 0; } } @@ -191,10 +192,10 @@ static void *dolisten(void * state) oldstatus = st->status; if(st->status == DEAD) { /* this timestamp is arbitraty */ - fprintf(stderr, "Connection with the client has been lost. Last reply since: %li \n", st->lastreply.tv_sec); + setting_verbose() ? fprintf(stderr, "Connection with the client has been lost. Last reply since: %li \n", st->lastreply.tv_sec) : 0; } else { ipstring = inet_ntoa(clientaddr.sin_addr); - fprintf(stderr, "Successful incoming connection from %s\n", ipstring); + setting_verbose() ? fprintf(stderr, "Successful incoming connection from %s\n", ipstring) : 0; } } pthread_mutex_unlock(&st->datamutex); |