aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornicm <nicm>2020-06-01 20:58:42 +0000
committernicm <nicm>2020-06-01 20:58:42 +0000
commit8339702d4779794de0fcb85dd620421ae5cf768b (patch)
tree9dd28905fff34c8dd01bfd9c11e6c12818fc6c6d
parent9819470058800953a1c487cc12f923d0a603c3dc (diff)
downloadrtmux-8339702d4779794de0fcb85dd620421ae5cf768b.tar.gz
rtmux-8339702d4779794de0fcb85dd620421ae5cf768b.tar.bz2
rtmux-8339702d4779794de0fcb85dd620421ae5cf768b.zip
Check the right thing for maximum client buffer size.
-rw-r--r--server-client.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/server-client.c b/server-client.c
index 5218340e..81af2f07 100644
--- a/server-client.c
+++ b/server-client.c
@@ -1510,6 +1510,7 @@ server_client_check_pane_buffer(struct window_pane *wp)
struct window_pane_offset *wpo;
int off = 1, flag;
u_int attached_clients = 0;
+ size_t new_size;
/*
* Work out the minimum used size. This is the most that can be removed
@@ -1535,12 +1536,15 @@ server_client_check_pane_buffer(struct window_pane *wp)
if (!flag)
off = 0;
- log_debug("%s: %s has %zu bytes used for %%%u", __func__,
- c->name, wpo->used - wp->base_offset, wp->id);
- if (wpo->used - wp->base_offset > SERVER_CLIENT_PANE_LIMIT) {
+ window_pane_get_new_data(wp, wpo, &new_size);
+ log_debug("%s: %s has %zu bytes used and %zu left for %%%u",
+ __func__, c->name, wpo->used - wp->base_offset, new_size,
+ wp->id);
+ if (new_size > SERVER_CLIENT_PANE_LIMIT) {
control_flush(c);
c->flags |= CLIENT_EXIT;
- } else if (wpo->used < minimum)
+ }
+ if (wpo->used < minimum)
minimum = wpo->used;
}
if (attached_clients == 0)