Check the right thing for maximum client buffer size.

pull/2270/head
nicm 2020-06-01 20:58:42 +00:00
parent 9819470058
commit 8339702d47
1 changed files with 8 additions and 4 deletions

View File

@ -1510,6 +1510,7 @@ server_client_check_pane_buffer(struct window_pane *wp)
struct window_pane_offset *wpo; struct window_pane_offset *wpo;
int off = 1, flag; int off = 1, flag;
u_int attached_clients = 0; u_int attached_clients = 0;
size_t new_size;
/* /*
* Work out the minimum used size. This is the most that can be removed * 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) if (!flag)
off = 0; off = 0;
log_debug("%s: %s has %zu bytes used for %%%u", __func__, window_pane_get_new_data(wp, wpo, &new_size);
c->name, wpo->used - wp->base_offset, wp->id); log_debug("%s: %s has %zu bytes used and %zu left for %%%u",
if (wpo->used - wp->base_offset > SERVER_CLIENT_PANE_LIMIT) { __func__, c->name, wpo->used - wp->base_offset, new_size,
wp->id);
if (new_size > SERVER_CLIENT_PANE_LIMIT) {
control_flush(c); control_flush(c);
c->flags |= CLIENT_EXIT; c->flags |= CLIENT_EXIT;
} else if (wpo->used < minimum) }
if (wpo->used < minimum)
minimum = wpo->used; minimum = wpo->used;
} }
if (attached_clients == 0) if (attached_clients == 0)