assert(wait_sync_flag(&channel_opened, 20));
// Re-initialize everything
+ meshlink_channel_close(a, channel);
close_meshlink_pair(a, b, "channels-cornercases");
b_responded = false;
b_closed = false;
assert(0 == a_poll_cb_len);
+ meshlink_channel_close(a, channel);
+ meshlink_channel_close(a, channel2);
+ close_meshlink_pair(a, b, "channels-cornercases");
+
return 0;
}
// Stream packets from server to clients for 5 seconds at 40 Mbps (1 kB * 500 Hz)
char data[1000];
+ memset(data, 'U', sizeof(data));
for(int j = 0; j < 2500; j++) {
for(int i = 0; i < 3; i++) {
// The invitation should work
assert(meshlink_join(mesh3, quux_url));
+ free(quux_url);
// Clean up.
#define _GNU_SOURCE
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
char *data[3];
for(int i = 0; i < 3; i++) {
- char *path;
- int ret_val;
- (void)ret_val;
- ret_val = asprintf(&path, "trio_conf.%d", i);
- assert(path);
+ char *path = NULL;
+ assert(asprintf(&path, "trio_conf.%d", i) != -1 && path);
mesh[i] = meshlink_open(path, name[i], "trio", DEV_CLASS_BACKBONE);
assert(mesh[i]);
+ free(path);
meshlink_add_address(mesh[i], "localhost");
devtool_edge_t *edges = NULL;
size_t nedges = 0;
assert_after((edges = devtool_get_all_edges(mesh[1], edges, &nedges), nedges == 3), 15);
+ free(edges);
// Stop the first node
#define _GNU_SOURCE
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
char *data[3];
for(int i = 0; i < 3; i++) {
- char *path;
- int ret_val;
- (void)ret_val;
- ret_val = asprintf(&path, "trio2_conf.%d", i);
- assert(path);
+ char *path = NULL;
+ assert(asprintf(&path, "trio2_conf.%d", i) != -1 && path);
mesh[i] = meshlink_open(path, name[i], "trio2", DEV_CLASS_BACKBONE);
assert(mesh[i]);
+ free(path);
meshlink_add_address(mesh[i], "localhost");
devtool_edge_t *edges = NULL;
size_t nedges = 0;
assert_after((edges = devtool_get_all_edges(mesh[1], edges, &nedges), nedges == 3), 15);
+ free(edges);
// Stop the nodes nodes
meshlink_handle_t *b = meshlink_open(b_name, "b", prefix, DEV_CLASS_BACKBONE);
assert(b);
+ free(a_name);
+ free(b_name);
+
meshlink_enable_discovery(a, false);
meshlink_enable_discovery(b, false);
ret_val = asprintf(&b_name, "%s_conf.2", prefix);
assert(b_name);
assert(meshlink_destroy(b_name));
+
+ free(a_name);
+ free(b_name);
}
}