X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fcontrol.c;h=c166943ba59a607aa0ba8a85198ef68303167bc6;hb=d917c8cb6b69475d568ccbe82389b9f2b3eb5e80;hp=46300ed9503bf0c4677d476ac86e335b3288f62c;hpb=ff306f0cdaedb50de1472e7c1fb55de922a6ca60;p=meshlink diff --git a/src/control.c b/src/control.c index 46300ed9..c166943b 100644 --- a/src/control.c +++ b/src/control.c @@ -29,7 +29,6 @@ #include "netutl.h" #include "protocol.h" #include "route.h" -#include "splay_tree.h" #include "utils.h" #include "xalloc.h" @@ -64,7 +63,7 @@ bool control_h(connection_t *c, const char *request) { case REQ_DUMP_NODES: return dump_nodes(c); - + case REQ_DUMP_EDGES: return dump_edges(c); @@ -99,15 +98,12 @@ bool control_h(connection_t *c, const char *request) { case REQ_DISCONNECT: { char name[MAX_STRING_SIZE]; - connection_t *other; bool found = false; if(sscanf(request, "%*d %*d " MAX_STRING, name) != 1) return control_return(c, REQ_DISCONNECT, -1); - for(list_node_t *node = connection_list->head, *next; node; node = next) { - next = node->next; - other = node->data; + for list_each(connection_t, other, connection_list) { if(strcmp(other->name, name)) continue; terminate_connection(other, other->status.active);