summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@yahoo.com>2017-05-27 21:58:13 +0300
committerDaniel Zaoui <daniel.zaoui@yahoo.com>2017-06-05 08:55:37 +0300
commit3a46e013fea05a1b680d70e5d2edbefbf9531ddf (patch)
tree29c16bf958992f8e3d08004453785199823c8ef5 /src/bin
parenta466eca4268ee7ff31e652911b3bde2f82a07c74 (diff)
downloadefl-3a46e013fea05a1b680d70e5d2edbefbf9531ddf.tar.gz
Fix connection closing
The client structure was not deleted when the connected application was suddenly terminated (ctrl-c). It was not happening before, so I suspect TCP and UNIX sockets behave differently on this matter.
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/efl/efl_debugd.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/bin/efl/efl_debugd.c b/src/bin/efl/efl_debugd.c
index f5881b85ef..52e10aa1be 100644
--- a/src/bin/efl/efl_debugd.c
+++ b/src/bin/efl/efl_debugd.c
@@ -130,7 +130,9 @@ _send(Client *dest, int opcode, void *payload, int payload_size)
hdr->thread_id = 0;
hdr->opcode = opcode;
memcpy(buf + sizeof(Eina_Debug_Packet_Header), payload, payload_size);
- //printf("%d bytes sent (opcode %s) to %s fd %d\n", size, _opcodes[opcode]->opcode_string, dest->app_name, dest->fd);
+ printf("Send packet (size = %d, opcode %s) to %s\n", size,
+ _opcodes[hdr->opcode]->opcode_string,
+ dest->app_name);
if (send(dest->fd, buf, size, 0) != size) perror("send");
}
@@ -404,9 +406,12 @@ _monitor()
if (events[i].events & EPOLLHUP)
{
c = _client_find_by_fd(events[i].data.fd);
- printf("Closing client %s/%d\n", c->app_name, c->pid);
close(events[i].data.fd);
- if (c) _client_del(c);
+ if (c)
+ {
+ printf("Closing client %s/%d\n", c->app_name, c->pid);
+ _client_del(c);
+ }
}
if (events[i].events & EPOLLIN)
{
@@ -448,6 +453,7 @@ _monitor()
// major failure on debug daemon control fd - get out of here.
// else goto fail;
close(events[i].data.fd);
+ _client_del(c);
//TODO if its not main session we will tell the main_loop
//that it disconneted
}