X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fnet_setup.c;h=7f8804b17be524cdfcc5d8d3abc9ad7cee20677b;hb=d1d09fadfe04b30d5275021524092341cb0c58c8;hp=4369692fde5004c151a47dd6ee363591ace61014;hpb=8eb1e508a3fd32a93f1dabab098b3293f527ac2b;p=meshlink-tiny diff --git a/src/net_setup.c b/src/net_setup.c index 4369692..7f8804b 100644 --- a/src/net_setup.c +++ b/src/net_setup.c @@ -28,7 +28,6 @@ #include "netutl.h" #include "packmsg.h" #include "protocol.h" -#include "route.h" #include "utils.h" #include "xalloc.h" @@ -342,7 +341,6 @@ static bool setup_myself(meshlink_handle_t *mesh) { bool setup_network(meshlink_handle_t *mesh) { init_connections(mesh); init_nodes(mesh); - init_requests(mesh); if(!setup_myself(mesh)) { return false; @@ -355,23 +353,15 @@ 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); exit_nodes(mesh); exit_connections(mesh); free(mesh->myport); mesh->myport = NULL; - mesh->self = NULL; - - return; }