From e5478b363ace021da2440ec9fe8daacfa6d672a6 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Thu, 24 Dec 2009 15:29:48 +0000 Subject: added end of watch list marker --- rhdropbox.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/rhdropbox.c b/rhdropbox.c index aca0cfb..83c6d10 100644 --- a/rhdropbox.c +++ b/rhdropbox.c @@ -149,21 +149,26 @@ void send_status_watch_list(int fd, watch_list_t* watch_lst, client_t* client_ls } char buf[100]; - int listener_cnt; watch_list_element_t* tmp = watch_lst->first_; while(tmp) { snprintf(buf, 100, "%3d: %s", tmp->watch_fd_, tmp->path_); if(fd > 0) send_response(fd, buf); - listener_cnt = 0; client_t* client; for(client = client_lst; client; client = client->next) - if(client->status_listener && client->fd != fd) { + if(client->status_listener && client->fd != fd) send_response(client->fd, buf); - listener_cnt++; - } tmp = tmp->next_; } + if(fd > 0) + send_response(fd, "end of watch list"); + int listener_cnt = 0; + client_t* client; + for(client = client_lst; client; client = client->next) + if(client->status_listener && client->fd != fd) { + send_response(client->fd, "end of watch list"); + listener_cnt++; + } log_printf(DEBUG, "sent status to %d additional listeners", listener_cnt); return; -- cgit v1.2.3