]> git.meshlink.io Git - meshlink-tiny/blobdiff - src/net_setup.c
Add a metering test.
[meshlink-tiny] / src / net_setup.c
index 4369692fde5004c151a47dd6ee363591ace61014..7f8804b17be524cdfcc5d8d3abc9ad7cee20677b 100644 (file)
@@ -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;
 }