diff options
author | 2020-06-01 09:43:00 +0000 | |
---|---|---|
committer | 2020-06-01 09:43:00 +0000 | |
commit | a34cf9c854af10b16e42da7f8b8e02d14cf4d44e (patch) | |
tree | fdfafcc3f79b8a18ea3700b43f7f2428263e0174 /usr.bin/tmux/cmd-queue.c | |
parent | Revert "Ignore new Rxblock ack agreements until the WPA handshake is done." (diff) | |
download | wireguard-openbsd-a34cf9c854af10b16e42da7f8b8e02d14cf4d44e.tar.xz wireguard-openbsd-a34cf9c854af10b16e42da7f8b8e02d14cf4d44e.zip |
Instead of sending all data to control mode clients as fast as possible,
add a limit of how much data will be sent to the client and try to use
it for panes with some degree of fairness. GitHub issue 2217, with
George Nachman.
Diffstat (limited to 'usr.bin/tmux/cmd-queue.c')
-rw-r--r-- | usr.bin/tmux/cmd-queue.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.bin/tmux/cmd-queue.c b/usr.bin/tmux/cmd-queue.c index b694fab97ae..b139fa014a4 100644 --- a/usr.bin/tmux/cmd-queue.c +++ b/usr.bin/tmux/cmd-queue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-queue.c,v 1.97 2020/05/16 16:35:13 nicm Exp $ */ +/* $OpenBSD: cmd-queue.c,v 1.98 2020/06/01 09:43:01 nicm Exp $ */ /* * Copyright (c) 2013 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -780,7 +780,7 @@ cmdq_guard(struct cmdq_item *item, const char *guard, int flags) u_int number = item->number; if (c != NULL && (c->flags & CLIENT_CONTROL)) - file_print(c, "%%%s %ld %u %d\n", guard, t, number, flags); + control_write(c, "%%%s %ld %u %d", guard, t, number, flags); } /* Show message from command. */ @@ -807,7 +807,10 @@ cmdq_print(struct cmdq_item *item, const char *fmt, ...) msg = utf8_sanitize(tmp); free(tmp); } - file_print(c, "%s\n", msg); + if (c->flags & CLIENT_CONTROL) + control_write(c, "%s", msg); + else + file_print(c, "%s\n", msg); } else { wp = server_client_get_pane(c); wme = TAILQ_FIRST(&wp->modes); @@ -849,7 +852,7 @@ cmdq_error(struct cmdq_item *item, const char *fmt, ...) free(tmp); } if (c->flags & CLIENT_CONTROL) - file_print(c, "%s\n", msg); + control_write(c, "%s", msg); else file_error(c, "%s\n", msg); c->retval = 1; |