]> git.meshlink.io Git - meshlink/blobdiff - src/meta.c
Stop using global variable mesh in net_packet.c.
[meshlink] / src / meta.c
index 14342608518aac02ee8c06cfe16d572e2935750a..42e947101657871df945eded603c039f2b3d29af 100644 (file)
@@ -37,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;
 }
@@ -53,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;
        }
 
@@ -89,7 +89,7 @@ bool receive_meta_sptps(void *handle, uint8_t type, const char *data, uint16_t l
        if(c->tcplen) {
                if(length != c->tcplen)
                        return false;
-               receive_tcppacket(c, data, length);
+               receive_tcppacket(mesh, c, data, length);
                c->tcplen = 0;
                return true;
        }