From a75ad97fb2ccb611b7403b6a821c0af09967d263 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Wed, 13 May 2009 01:16:31 +0000 Subject: [PATCH] status listeners now always get Status: messages --- door_daemon/door_daemon.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/door_daemon/door_daemon.c b/door_daemon/door_daemon.c index f8a3982..ea3e0d6 100644 --- a/door_daemon/door_daemon.c +++ b/door_daemon/door_daemon.c @@ -228,15 +228,18 @@ int process_door(int door_fd, cmd_t **cmd_q, client_t* client_lst) char* saveptr; char* tok = strtok_r(buffer, "\n\r", &saveptr); do { - if(!cmd_q || !(*cmd_q)) - break; + log_printf(NOTICE, "door-firmware: %s", tok); - send_response((*cmd_q)->fd, tok); + int cmd_fd = -1; + if(cmd_q && (*cmd_q)) { + cmd_fd = (*cmd_q)->fd; + send_response(cmd_fd, tok); + } if(!strncmp(tok, "Status:", 7)) { client_t* client; for(client = client_lst; client; client = client->next) - if(client->status_listener && client->fd != (*cmd_q)->fd) + if(client->status_listener && client->fd != cmd_fd) send_response(client->fd, tok); } -- 1.7.10.4