From: Guus Sliepen Date: Mon, 18 May 2020 21:24:56 +0000 (+0200) Subject: Fix assert that could incorrectly be triggered when a peer closed the channel. X-Git-Url: http://git.meshlink.io/?p=meshlink;a=commitdiff_plain;h=0f0bea383106de1a896905fdf8a56f55265bce74 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. --- 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)) {