areguera / rpms / cockpit

Forked from rpms/cockpit 5 years ago
Clone
Blob Blame History Raw
From a3fe60b76193199b7244c23274fe1b8d10a6aff4 Mon Sep 17 00:00:00 2001
From: Stef Walter <stefw@redhat.com>
Date: Fri, 7 Sep 2018 18:56:44 +0200
Subject: [PATCH] common: Fix off by one error in flow control

This led to hangs when the ping sequence number replied to
was exactly equal to the throttling window. We would only
consider unthrottling when the sequence was greater than
the throttling window.

Fixes #10013
Closes #10020
---
 src/common/cockpitchannel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/common/cockpitchannel.c b/src/common/cockpitchannel.c
index 2d26879f7..563194960 100644
--- a/src/common/cockpitchannel.c
+++ b/src/common/cockpitchannel.c
@@ -234,7 +234,7 @@ process_pong (CockpitChannel *self,
                  self->priv->id, sequence);
     }
 
-  if (sequence > self->priv->out_window)
+  if (sequence >= self->priv->out_window)
     {
       /* Up to this point has been confirmed received */
       self->priv->out_window = sequence + CHANNEL_FLOW_WINDOW;
-- 
2.17.1