summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2017-02-08 08:54:46 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2017-02-08 08:54:46 +0000
commit52c2c7e851ea2ce7635efc7468f8fd871eab9116 (patch)
treec4085ca3193b15863eb445118b56de844048e1d8
parente2f7795aa3258d08bd5a0e63dc430454a1dbbcb3 (diff)
Log size of output buffer as well.
-rw-r--r--usr.bin/tmux/tty.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c
index 8c78b1b23d9..4e597ae4c5e 100644
--- a/usr.bin/tmux/tty.c
+++ b/usr.bin/tmux/tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty.c,v 1.233 2017/02/08 08:50:10 nicm Exp $ */
+/* $OpenBSD: tty.c,v 1.234 2017/02/08 08:54:45 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -439,32 +439,36 @@ tty_putcode_ptr2(struct tty *tty, enum tty_code_code code, const void *a,
void
tty_puts(struct tty *tty, const char *s)
{
+ size_t size = EVBUFFER_LENGTH(tty->event->output);
+
if (*s == '\0')
return;
+
bufferevent_write(tty->event, s, strlen(s));
+ log_debug("%s (%zu): %s", tty->path, size, s);
if (tty_log_fd != -1)
write(tty_log_fd, s, strlen(s));
- log_debug("%s: %s", tty->path, s);
}
void
tty_putc(struct tty *tty, u_char ch)
{
+ size_t size = EVBUFFER_LENGTH(tty->event->output);
const char *acs;
if (tty->cell.attr & GRID_ATTR_CHARSET) {
acs = tty_acs_get(tty, ch);
if (acs != NULL) {
bufferevent_write(tty->event, acs, strlen(acs));
- log_debug("%s: %s", tty->path, acs);
+ log_debug("%s (%zu): %s", tty->path, size, acs);
} else {
bufferevent_write(tty->event, &ch, 1);
- log_debug("%s: %c", tty->path, ch);
+ log_debug("%s (%zu): %c", tty->path, size, ch);
}
} else {
bufferevent_write(tty->event, &ch, 1);
- log_debug("%s: %c", tty->path, ch);
+ log_debug("%s (%zu): %c", tty->path, size, ch);
}
if (ch >= 0x20 && ch != 0x7f) {
@@ -491,11 +495,13 @@ tty_putc(struct tty *tty, u_char ch)
void
tty_putn(struct tty *tty, const void *buf, size_t len, u_int width)
{
+ size_t size = EVBUFFER_LENGTH(tty->event->output);
+
bufferevent_write(tty->event, buf, len);
+ log_debug("%s (%zu): %.*s", tty->path, size, (int)len, (char *)buf);
if (tty_log_fd != -1)
write(tty_log_fd, buf, len);
- log_debug("%s: %.*s", tty->path, (int)len, (char *)buf);
tty->cx += width;
}