]> git.meshlink.io Git - meshlink/blobdiff - src/net_setup.c
Stop using global variable mesh in net.c.
[meshlink] / src / net_setup.c
index 02e90aefe078191777c7b29f19d2c91749af19aa..eae283d6aed9c5b68c74f17296825e1c8c1be625 100644 (file)
@@ -380,19 +380,19 @@ bool setup_network(meshlink_handle_t *mesh) {
 /*
   close all open network connections
 */
-void close_network_connections(void) {
+void close_network_connections(meshlink_handle_t *mesh) {
        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(c, false);
+               terminate_connection(mesh, c, false);
        }
 
        if(mesh->outgoings)
                list_delete_list(mesh->outgoings);
 
        if(mesh->self && mesh->self->connection) {
-               terminate_connection(mesh->self->connection, false);
+               terminate_connection(mesh, mesh->self->connection, false);
                free_connection(mesh->self->connection);
        }