]> git.meshlink.io Git - meshlink-tiny/blobdiff - src/meta.c
Remove all support for channels.
[meshlink-tiny] / src / meta.c
index 09edf79d503b920a0e6739d1ea4d9b2c3355b1a0..12241f819892fc13bde6891b688e89ea908f803e 100644 (file)
@@ -47,7 +47,7 @@ bool send_meta_sptps(void *handle, uint8_t type, const void *buffer, size_t leng
 bool send_meta(meshlink_handle_t *mesh, connection_t *c, const char *buffer, int length) {
        assert(c);
        assert(buffer);
-       assert(length);
+       assert(length >= 0);
 
        logger(mesh, MESHLINK_DEBUG, "Sending %d bytes of metadata to %s", length, c->name);
 
@@ -95,6 +95,18 @@ bool receive_meta_sptps(void *handle, uint8_t type, const void *data, uint16_t l
                return true;
        }
 
+       /* Are we receiving a raw packet? */
+
+       if(c->status.raw_packet) {
+               c->status.raw_packet = false;
+
+               if(mesh->receive_cb) {
+                       mesh->receive_cb(mesh, (meshlink_node_t *)c->node, data, length);
+               }
+
+               return true;
+       }
+
        /* Change newline to null byte, just like non-SPTPS requests */
 
        if(request[length - 1] == '\n') {