]> git.meshlink.io Git - meshlink/commitdiff
Don't call abort() when no channel receive callback is set.
authorGuus Sliepen <guus@meshlink.io>
Thu, 27 Jul 2017 09:03:09 +0000 (11:03 +0200)
committerGuus Sliepen <guus@meshlink.io>
Thu, 27 Jul 2017 09:03:09 +0000 (11:03 +0200)
src/meshlink.c

index 1771202f8b729184aac9508184f1e15bb0f1d68f..a69b3851dfca26432327266e663c9b60e6b09e3a 100644 (file)
@@ -2163,12 +2163,9 @@ static ssize_t channel_recv(struct utcp_connection *connection, const void *data
                abort();
        node_t *n = channel->node;
        meshlink_handle_t *mesh = n->mesh;
-       if(!channel->receive_cb)
-               return -1;
-       else {
+       if(channel->receive_cb)
                channel->receive_cb(mesh, channel, data, len);
-               return len;
-       }
+       return len;
 }
 
 static void channel_accept(struct utcp_connection *utcp_connection, uint16_t port) {