]> git.meshlink.io Git - meshlink/blobdiff - src/meta.c
Remove global variables from the event loop code.
[meshlink] / src / meta.c
index 160333b2c4cb140ced2bb17395ab550f0d6cb89d..ccf333dbe012e65c7026b4ec8bce855f0682e05c 100644 (file)
@@ -19,7 +19,6 @@
 
 #include "system.h"
 
-#include "cipher.h"
 #include "connection.h"
 #include "logger.h"
 #include "meshlink_internal.h"
@@ -38,7 +37,7 @@ bool send_meta_sptps(void *handle, uint8_t type, const char *buffer, size_t leng
        }
 
        buffer_add(&c->outbuf, buffer, length);
-       io_set(&c->io, IO_READ | IO_WRITE);
+       io_set(&mesh->loop, &c->io, IO_READ | IO_WRITE);
 
        return true;
 }
@@ -54,7 +53,7 @@ bool send_meta(connection_t *c, const char *buffer, int length) {
 
        if(c->allow_request == ID) {
                buffer_add(&c->outbuf, buffer, length);
-               io_set(&c->io, IO_READ | IO_WRITE);
+               io_set(&mesh->loop, &c->io, IO_READ | IO_WRITE);
                return true;
        }