]> git.meshlink.io Git - meshlink/commitdiff
When opening a mesh handle, inherit the global log callback.
authorGuus Sliepen <guus@meshlink.io>
Thu, 5 Sep 2019 17:32:42 +0000 (19:32 +0200)
committerGuus Sliepen <guus@meshlink.io>
Thu, 5 Sep 2019 18:00:11 +0000 (20:00 +0200)
This prevents losing log messages halfway during meshlink_open().

src/meshlink.c

index e65b7b199c76205d82c9fb76e3ea55ada5c08322..ebe585d2960eed6c0271e03716507a85972c7c7b 100644 (file)
@@ -1269,6 +1269,8 @@ meshlink_handle_t *meshlink_open_ex(const meshlink_open_params_t *params) {
        mesh->invitation_timeout = 604800; // 1 week
        mesh->netns = params->netns;
        mesh->submeshes = NULL;
        mesh->invitation_timeout = 604800; // 1 week
        mesh->netns = params->netns;
        mesh->submeshes = NULL;
+       mesh->log_cb = global_log_cb;
+       mesh->log_level = global_log_level;
 
        memcpy(mesh->dev_class_traits, default_class_traits, sizeof(default_class_traits));
 
 
        memcpy(mesh->dev_class_traits, default_class_traits, sizeof(default_class_traits));