From aad97d717a86b999c5ebf105131471550023dbc8 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Wed, 27 May 2020 21:02:22 +0200 Subject: [PATCH] Correctly report the maximum allowed send size in the poll callback for framed channels. --- src/utcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utcp.c b/src/utcp.c index cbc094a1..8ef59a06 100644 --- a/src/utcp.c +++ b/src/utcp.c @@ -2433,7 +2433,7 @@ struct timespec utcp_timeout(struct utcp *utcp) { if(c->poll) { if((c->state == ESTABLISHED || c->state == CLOSE_WAIT) && c->do_poll) { c->do_poll = false; - uint32_t len = buffer_free(&c->sndbuf); + uint32_t len = is_framed(c) ? min(buffer_free(&c->sndbuf), MAX_UNRELIABLE_SIZE) : buffer_free(&c->sndbuf); if(len) { c->poll(c, len); -- 2.39.2