]> git.meshlink.io Git - meshlink/commitdiff
Fix assert that could incorrectly be triggered when a peer closed the channel.
authorGuus Sliepen <guus@meshlink.io>
Mon, 18 May 2020 21:24:56 +0000 (23:24 +0200)
committerGuus Sliepen <guus@meshlink.io>
Mon, 18 May 2020 21:24:56 +0000 (23:24 +0200)
If we are sending AIO data on a channel and the peer closed the connection,
we could trigger an assert incorrectly.

src/meshlink.c

index 5815a7772e9e9e5c738dd3f1e94ca140b2d9bbd5..14ff7155888c96a04ff33945dfd71dcf9e4481dd 100644 (file)
@@ -3701,7 +3701,7 @@ static void channel_poll(struct utcp_connection *connection, size_t len) {
 
                if(sent != (ssize_t)todo) {
                        /* We should never get a partial send at this point */
-                       assert(sent < 0);
+                       assert(sent <= 0);
 
                        /* Sending failed, abort all outstanding AIO buffers and send a poll callback. */
                        if(!aio_abort(mesh, channel, &channel->aio_send)) {