aboutsummaryrefslogtreecommitdiff
path: root/window.c
diff options
context:
space:
mode:
authornicm <nicm>2016-04-29 13:36:10 +0000
committernicm <nicm>2016-04-29 13:36:10 +0000
commitc5443da2d3bd5ef2464cc59941e55890aaff3fb0 (patch)
treef68c095a513a9beffdec79667bbcc371e1dffd7a /window.c
parent5f2bfd980737d2f13b744e288532e5d2daf97a0f (diff)
downloadrtmux-c5443da2d3bd5ef2464cc59941e55890aaff3fb0.tar.gz
rtmux-c5443da2d3bd5ef2464cc59941e55890aaff3fb0.tar.bz2
rtmux-c5443da2d3bd5ef2464cc59941e55890aaff3fb0.zip
The backoff timer is causing no end of trouble with disconnected clients
stopping data in attached ones. So get rid of it and see how we get on with just a high watermark on each pane.
Diffstat (limited to 'window.c')
-rw-r--r--window.c39
1 files changed, 3 insertions, 36 deletions
diff --git a/window.c b/window.c
index 1769552f..ff90906f 100644
--- a/window.c
+++ b/window.c
@@ -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