summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/tmux/tmux.h14
-rw-r--r--usr.bin/tmux/window.c41
2 files changed, 7 insertions, 48 deletions
diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h
index 46a230501f4..9c33c4bf790 100644
--- a/usr.bin/tmux/tmux.h
+++ b/usr.bin/tmux/tmux.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmux.h,v 1.625 2016/04/29 13:21:33 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.626 2016/04/29 13:36:10 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -60,15 +60,8 @@ struct tmuxproc;
/* Automatic name refresh interval, in microseconds. Must be < 1 second. */
#define NAME_INTERVAL 500000
-/*
- * READ_SIZE is the maximum size of data to hold from a pty (the event high
- * watermark). READ_BACKOFF is the amount of data waiting to be output to a tty
- * before pty reads will be backed off. READ_TIME is how long to back off
- * before the next read (in microseconds) if a tty is above READ_BACKOFF.
- */
-#define READ_SIZE 1024
-#define READ_BACKOFF 512
-#define READ_TIME 100
+/* The maximum amount of data to hold from a pty (the event high watermark). */
+#define READ_SIZE 128
/* Attribute to make gcc check printf-like arguments. */
#define printflike(a, b) __attribute__ ((format (printf, a, b)))
@@ -889,7 +882,6 @@ struct window_pane {
int fd;
struct bufferevent *event;
- struct event timer;
struct input_ctx *ictx;
diff --git a/usr.bin/tmux/window.c b/usr.bin/tmux/window.c
index 6a79281d3e0..9c01c7ea48f 100644
--- a/usr.bin/tmux/window.c
+++ b/usr.bin/tmux/window.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: window.c,v 1.157 2016/03/01 12:05:15 nicm Exp $ */
+/* $OpenBSD: window.c,v 1.158 2016/04/29 13:36:11 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -777,9 +777,6 @@ window_pane_destroy(struct window_pane *wp)
{
window_pane_reset_mode(wp);
- if (event_initialized(&wp->timer))
- evtimer_del(&wp->timer);
-
if (wp->fd != -1) {
bufferevent_free(wp->event);
close(wp->fd);
@@ -917,34 +914,15 @@ window_pane_spawn(struct window_pane *wp, int argc, char **argv,
}
void
-window_pane_timer_callback(__unused int fd, __unused short events, void *data)
-{
- window_pane_read_callback(NULL, data);
-}
-
-void
window_pane_read_callback(__unused struct bufferevent *bufev, void *data)
{
struct window_pane *wp = data;
struct evbuffer *evb = wp->event->input;
char *new_data;
- size_t new_size, available;
- struct client *c;
- struct timeval tv;
-
- if (event_initialized(&wp->timer))
- evtimer_del(&wp->timer);
+ size_t new_size;
- log_debug("%%%u has %zu bytes", wp->id, EVBUFFER_LENGTH(evb));
-
- TAILQ_FOREACH(c, &clients, entry) {
- if (!tty_client_ready(c, wp))
- continue;
-
- available = EVBUFFER_LENGTH(c->tty.event->output);
- if (available > READ_BACKOFF)
- goto start_timer;
- }
+ log_debug("%%%u has %zu bytes (of %zu)", wp->id, EVBUFFER_LENGTH(evb),
+ (size_t)READ_SIZE);
new_size = EVBUFFER_LENGTH(evb) - wp->pipe_off;
if (wp->pipe_fd != -1 && new_size > 0) {
@@ -955,17 +933,6 @@ window_pane_read_callback(__unused struct bufferevent *bufev, void *data)
input_parse(wp);
wp->pipe_off = EVBUFFER_LENGTH(evb);
- return;
-
-start_timer:
- log_debug("%%%u backing off (%s %zu > %d)", wp->id, c->ttyname,
- available, READ_BACKOFF);
-
- tv.tv_sec = 0;
- tv.tv_usec = READ_TIME;
-
- evtimer_set(&wp->timer, window_pane_timer_callback, wp);
- evtimer_add(&wp->timer, &tv);
}
void