diff options
author | nicm <nicm> | 2020-06-01 09:43:00 +0000 |
---|---|---|
committer | nicm <nicm> | 2020-06-01 09:43:00 +0000 |
commit | a54a88edd6fd893d4370feb9f9136e13096b891c (patch) | |
tree | 1e42bf42d42c31e1ef3c059aaf1ae25ae6ef3bd5 /cmd-queue.c | |
parent | 175e45005f4572b19a4aa34094f9a8c69ced5475 (diff) | |
download | rtmux-a54a88edd6fd893d4370feb9f9136e13096b891c.tar.gz rtmux-a54a88edd6fd893d4370feb9f9136e13096b891c.tar.bz2 rtmux-a54a88edd6fd893d4370feb9f9136e13096b891c.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 'cmd-queue.c')
-rw-r--r-- | cmd-queue.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/cmd-queue.c b/cmd-queue.c index b0c70428..693f7d90 100644 --- a/cmd-queue.c +++ b/cmd-queue.c @@ -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; |