diff options
author | Laurent Ghigonis <laurent@p1sec.com> | 2012-12-02 06:53:41 +0100 |
---|---|---|
committer | Laurent Ghigonis <laurent@p1sec.com> | 2012-12-02 06:53:41 +0100 |
commit | 2e21847d40b1c891d29f776828d8ab5f42db0dc4 (patch) | |
tree | 01cfe8bdbd410a2005c601ddd81dc3fa96bec49d /libglouglou/libglouglou.c | |
parent | fix 2 bugs. (diff) | |
download | glouglou-2e21847d40b1c891d29f776828d8ab5f42db0dc4.tar.xz glouglou-2e21847d40b1c891d29f776828d8ab5f42db0dc4.zip |
use while(LIST_FIRST) as a LIST_FOREACH_SAFE ... and remove useless debug printf
Diffstat (limited to 'libglouglou/libglouglou.c')
-rw-r--r-- | libglouglou/libglouglou.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libglouglou/libglouglou.c b/libglouglou/libglouglou.c index 7cf1d6a..5a08e07 100644 --- a/libglouglou/libglouglou.c +++ b/libglouglou/libglouglou.c @@ -135,8 +135,9 @@ gg_server_stop(struct gg_server *srv) { struct gg_user *usr; - LIST_FOREACH(usr, &srv->user_list, entry) + while ((usr = LIST_FIRST(&srv->user_list))) { user_del(srv, usr); + } if (srv->sock) close(srv->sock); if (srv->ev) @@ -377,7 +378,6 @@ client_send(struct gg_client *cli, void *data, int size) { int sent; - debug("%d: %x", size, data); sent = sendto(cli->sock, data, size, 0, (struct sockaddr *)&cli->addr, sizeof(struct sockaddr_in)); if (sent == -1) |