]> git.meshlink.io Git - meshlink-tiny/blobdiff - src/net_setup.c
Remove support for multiple connections.
[meshlink-tiny] / src / net_setup.c
index 4369692fde5004c151a47dd6ee363591ace61014..96392809323abc57f11c2e78030e16f2be214cc0 100644 (file)
@@ -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);