From 187fe61700fc97fff565ec53aac65c664042feae Mon Sep 17 00:00:00 2001 From: Gediminas Jakutis Date: Wed, 29 May 2019 13:03:49 +0300 Subject: daemon: get ready to use messaging interfaces. Signed-off-by: Gediminas Jakutis --- src/daemon/net.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/daemon/net.c') diff --git a/src/daemon/net.c b/src/daemon/net.c index 29f1fde..62172fe 100644 --- a/src/daemon/net.c +++ b/src/daemon/net.c @@ -165,7 +165,7 @@ int net_send(int nd, const char * const buf, size_t buf_size) ssize_t sent; struct timespec now; - if (nd > count || nd < 1 || state[--nd].available) { + if (nd > count || nd < 1 || state[--nd].available || state[nd].status != A_OK) { ret = ERROR; } else { if (setting_verbose() >= INFO) { @@ -250,10 +250,10 @@ static void *dolisten(void * state) if (oldstatus != st->status) { oldstatus = st->status; - if(st->status == DEAD) { + if (st->status == DEAD) { /* this timestamp is arbitraty */ setting_verbose() >= INFO ? fprintf(stderr, "Connection with the client has been lost. Last reply since: %li \n", st->lastreply.tv_sec) : 0; - } else { + } else if (st->status == A_OK) { ipstring = inet_ntoa(st->clientaddr.sin_addr); setting_verbose() >= INFO ? fprintf(stderr, "Successful incoming connection from %s\n", ipstring) : 0; } -- cgit v1.2.3