From: Christian Pointner Date: Wed, 13 May 2009 01:16:31 +0000 (+0000) Subject: status listeners now always get Status: messages X-Git-Url: https://git.realraum.at/?a=commitdiff_plain;h=a75ad97fb2ccb611b7403b6a821c0af09967d263;p=svn42.git status listeners now always get Status: messages --- 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); }