From 63e0f6da6c90729a259a2fc36eabc26d18898698 Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Mon, 31 Jan 2022 07:55:13 +0100 Subject: fixed rbuf --- ecp/src/rbuf_recv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'ecp') diff --git a/ecp/src/rbuf_recv.c b/ecp/src/rbuf_recv.c index 98b472c..a3f2345 100644 --- a/ecp/src/rbuf_recv.c +++ b/ecp/src/rbuf_recv.c @@ -308,7 +308,10 @@ ssize_t ecp_rbuf_store(ECPConnection *conn, ecp_seq_t seq, unsigned char *msg, s if (rv < 0) return rv; buf->ack_map |= ack_bit; - do_ack = ack_shift(buf); + /* reliable transport can prevent seq_ack from reaching seq_max */ + if (ECP_SEQ_LT(buf->seq_ack, rbuf->seq_max)) { + do_ack = ack_shift(buf); + } } else { return ECP_ERR_RBUF_DUP; } -- cgit v1.2.3