From 0f0bea383106de1a896905fdf8a56f55265bce74 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Mon, 18 May 2020 23:24:56 +0200 Subject: [PATCH] Fix assert that could incorrectly be triggered when a peer closed the channel. If we are sending AIO data on a channel and the peer closed the connection, we could trigger an assert incorrectly. --- src/meshlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/meshlink.c b/src/meshlink.c index 5815a777..14ff7155 100644 --- a/src/meshlink.c +++ b/src/meshlink.c @@ -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)) { -- 2.39.2