X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fnet_setup.c;h=96392809323abc57f11c2e78030e16f2be214cc0;hb=664466227602b6aabd4f601cf57183bbfa45bc08;hp=4369692fde5004c151a47dd6ee363591ace61014;hpb=8eb1e508a3fd32a93f1dabab098b3293f527ac2b;p=meshlink-tiny diff --git a/src/net_setup.c b/src/net_setup.c index 4369692..9639280 100644 --- a/src/net_setup.c +++ b/src/net_setup.c @@ -355,13 +355,9 @@ bool setup_network(meshlink_handle_t *mesh) { close all open network connections */ void close_network_connections(meshlink_handle_t *mesh) { - if(mesh->connections) { - for(list_node_t *node = mesh->connections->head, *next; node; node = next) { - next = node->next; - connection_t *c = node->data; - c->outgoing = NULL; - terminate_connection(mesh, c, false); - } + if(mesh->connection) { + mesh->connection->outgoing = NULL; + terminate_connection(mesh, mesh->connection, false); } exit_requests(mesh);