diff options
author | 2019-05-29 13:03:49 +0300 | |
---|---|---|
committer | 2019-05-29 13:03:49 +0300 | |
commit | 187fe61700fc97fff565ec53aac65c664042feae (patch) | |
tree | 498d0c00af96c4f666b4ef4dbb6db0966a485852 /src/daemon/net.c | |
parent | aef4eba5572d6b42f8ef2913ec41c0e778731960 (diff) | |
download | usurpation-187fe61700fc97fff565ec53aac65c664042feae.tar.gz usurpation-187fe61700fc97fff565ec53aac65c664042feae.tar.bz2 usurpation-187fe61700fc97fff565ec53aac65c664042feae.zip |
daemon: get ready to use messaging interfaces.
Signed-off-by: Gediminas Jakutis <gediminas@varciai.lt>
Diffstat (limited to 'src/daemon/net.c')
-rw-r--r-- | src/daemon/net.c | 6 |
1 files changed, 3 insertions, 3 deletions
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; } |