diff options
-rw-r--r-- | rhdropbox.c | 15 |
1 files 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; |