ctdb-common: Add wait_send/wait_recv to sock_daemon_funcs
authorAmitay Isaacs <amitay@gmail.com>
Wed, 11 Jan 2017 09:37:00 +0000 (20:37 +1100)
committerStefan Metzmacher <metze@samba.org>
Mon, 16 Jan 2017 20:16:51 +0000 (21:16 +0100)
commited722c3aa9690873af495cb467dd440c1a714d82
tree802765d15755698a1169dcc4c33c77669065c538
parentd09469e575233242eab2a8c1c0767f52e7cad1e5
ctdb-common: Add wait_send/wait_recv to sock_daemon_funcs

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12510

To be able to terminate the daemon from within the implementation,
create a subreq using wait_send() provided by the implementation.
When the subreq is finished, it signals the sock_daemon code to terminate
the daemon.

This avoids the need to keep track of the top level tevent_req causing
layer violation and keeps the code flow straighforward.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Mon Jan 16 21:16:51 CET 2017 on sn-devel-144
ctdb/common/sock_daemon.c
ctdb/common/sock_daemon.h
ctdb/tests/cunit/sock_daemon_test_001.sh
ctdb/tests/src/sock_daemon_test.c