summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/server-window.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2010-08-11 07:34:43 +0000
committernicm <nicm@openbsd.org>2010-08-11 07:34:43 +0000
commit5bfee1d22035dbb758da3313e8f7d54935c81716 (patch)
tree9757611107b237fc50c1d05d8f4ad79b2a28f8dd /usr.bin/tmux/server-window.c
parentShow which pane is active in the list-panes output, suggested by Dominik (diff)
downloadwireguard-openbsd-5bfee1d22035dbb758da3313e8f7d54935c81716.tar.xz
wireguard-openbsd-5bfee1d22035dbb758da3313e8f7d54935c81716.zip
Change the way backoff works. Instead of stopping reading from the pty
when the client tty backs up too much, just stop updating the tty and only update the internal screen. Then when the tty recovers, force a redraw. This prevents a dodgy client from causing other clients to go into backoff while still allowing tmux to be responsive (locally) when seeing lots of output.
Diffstat (limited to 'usr.bin/tmux/server-window.c')
-rw-r--r--usr.bin/tmux/server-window.c38
1 files changed, 1 insertions, 37 deletions
diff --git a/usr.bin/tmux/server-window.c b/usr.bin/tmux/server-window.c
index c2a00c4c46c..e6f9b35b2e6 100644
--- a/usr.bin/tmux/server-window.c
+++ b/usr.bin/tmux/server-window.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server-window.c,v 1.16 2010/07/19 21:13:03 nicm Exp $ */
+/* $OpenBSD: server-window.c,v 1.17 2010/08/11 07:34:43 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -29,31 +29,6 @@ int server_window_check_activity(struct session *, struct winlink *);
int server_window_check_content(
struct session *, struct winlink *, struct window_pane *);
-/* Check if this window should suspend reading. */
-int
-server_window_backoff(struct window_pane *wp)
-{
- struct client *c;
- u_int i;
-
- if (!window_pane_visible(wp))
- return (0);
-
- for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
- c = ARRAY_ITEM(&clients, i);
- if (c == NULL || c->session == NULL)
- continue;
- if ((c->flags & (CLIENT_SUSPENDED|CLIENT_DEAD)) != 0)
- continue;
- if (c->session->curw->window != wp->window)
- continue;
-
- if (EVBUFFER_LENGTH(c->tty.event->output) > BACKOFF_THRESHOLD)
- return (1);
- }
- return (0);
-}
-
/* Window functions that need to happen every loop. */
void
server_window_loop(void)
@@ -69,17 +44,6 @@ server_window_loop(void)
if (w == NULL)
continue;
- TAILQ_FOREACH(wp, &w->panes, entry) {
- if (wp->fd == -1)
- continue;
- if (!(wp->flags & PANE_FREEZE)) {
- if (server_window_backoff(wp))
- bufferevent_disable(wp->event, EV_READ);
- else
- bufferevent_enable(wp->event, EV_READ);
- }
- }
-
for (j = 0; j < ARRAY_LENGTH(&sessions); j++) {
s = ARRAY_ITEM(&sessions, j);
if (s == NULL)