summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2009-12-24 15:29:48 (GMT)
committerChristian Pointner <equinox@helsinki.at>2009-12-24 15:29:48 (GMT)
commite5478b363ace021da2440ec9fe8daacfa6d672a6 (patch)
tree166d791c7384946fda439bf66b2289d32fb6ed26
parentc8a81cebcb6efbb61b0f4f801963f279f161d9d2 (diff)
added end of watch list marker
-rw-r--r--rhdropbox.c15
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;