From b4cd5273bccc8ae09da2a60a11a7c9946fc2d9db Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 19 May 2014 21:40:23 +0200 Subject: add broadcast support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/mds-server/mds-server.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/mds-server/mds-server.c b/src/mds-server/mds-server.c index 55db770..3179ee7 100644 --- a/src/mds-server/mds-server.c +++ b/src/mds-server/mds-server.c @@ -259,13 +259,19 @@ void* slave_loop(void* data) size_t information_address = fd_table_get(&client_map, (size_t)socket_fd); client_t* information = (client_t*)(void*)information_address; char* msgbuf = NULL; + char buf[] = "To: all"; size_t n; int r; - /* Intiailsie the client. */ - if (information == NULL) - fail_if ((information = initialise_client(socket_fd)) == NULL); + if (information == NULL) /* Did not re-exec. */ + { + /* Initialise the client. */ + fail_if ((information = initialise_client(socket_fd)) == NULL); + + /* Register client to receive broadcasts. */ + add_intercept_condition(information, buf, 0, 0, 0); + } /* Store slave thread and create mutexes and conditions. */ fail_if (client_initialise_threading(information)); -- cgit v1.2.3-70-g09d2